Results 1 to 2 of 2
I have a program with several source files that I am compiling with gcc using a makefile, configure script, etc. I got the program working for the most part, there ...
- 08-20-2009 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 27
File does not compile if any changes made to source files
I have a program with several source files that I am compiling with gcc using a makefile, configure script, etc. I got the program working for the most part, there is just one thing I have to change, but if I make any changes to any of the source files and recompile, I get a slew of unrelated errors input/output errors with stdio.h and with the file I changed. Is there a quick fix to this?
The changes can be anything, a comment, a new line, etc.
Here is the output after making a change to FileX:
Code:make all-am make[1]: Entering directory `Pgm/build' m68k-elf-gcc -DHAVE_CONFIG_H -I. -I.. -O3 -Wno-main -fomit-frame-pointer -I../../../include -m68000 -Wa,-alh="./`echo "FileX.o" | sed -e "s/\.o/\.lst/g"`",-L -g -O2 -MT FileX.o -MD -MP -MF .deps/FileX.Tpo -c -o FileX.o ../FileX.c In file included from ../FileX.c:1: /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:25: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:49: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:53: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:59: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:63: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ftello' /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:66: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:70: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:73: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:95: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:100: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:104: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:108: error: expected declaration specifiers or '...' before 'FILE' /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:118: error: expected declaration specifiers or '...' before 'FILE' /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:125: error: expected ')' before '*' token /opt/m68k/lib/gcc/m68k-elf/4.1.1/include/stdio.h:137: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token In file included from ../FileX.c:6: ../FileY.h:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token ../FileY.h:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token ../FileY.h:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token ../FileY.h:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token ../FileY.h:85: error: expected ')' before '*' token ../FileX.c: In function 'CheckTimerQ': ../FileX.c:82: warning: incompatible implicit declaration of built-in function 'fprintf' ../FileX.c:82: error: 'OutputFile' undeclared (first use in this function) ../FileX.c:82: error: (Each undeclared identifier is reported only once ../FileX.c:82: error: for each function it appears in.) ../FileX.c: In function 'CheckProcessQ': ../FileX.c:189: warning: incompatible implicit declaration of built-in function 'fprintf' ../FileX.c:189: error: 'OutputFile' undeclared (first use in this function) ../FileX.c: In function 'ExecuteProcess': ../FileX.c:210: warning: incompatible implicit declaration of built-in function 'fprintf' ../FileX.c:210: error: 'OutputFile' undeclared (first use in this function) ../FileX.c: In function 'CheckIoQ': ../FileX.c:392: warning: incompatible implicit declaration of built-in function 'fprintf' ../FileX.c:392: error: 'OutputFile' undeclared (first use in this function) make[1]: *** [FileX.o] Error 1 make[1]: Leaving directory `Pgm/build' make: *** [all] Error 2
Note that if I replace the files with older versions that have not been edited, they work (I do not get these errors because all the functions are properly initialized, etc. )
Thanks!
- 08-21-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
This is obviously an error on your part. Please post the original file and the changes you made.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote