Hello: I've been doing some coding and started getting this error when I compiled:
Quote
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status make[1]: *** [rom] Error 1
Now, it looks like my main is right in comm.c
int main args( ( int argc, char **argv ) );
int main( int argc, char **argv )
What could I have wrong?
27 Mar, 2013, Rarva.Riendf wrote in the 2nd comment:
27 Mar, 2013, Rarva.Riendf wrote in the 4th comment:
Votes: 0
Well try to revert the latest change you did before it stopped compiling. It may not be related to your main function at all. Maybe some other linking problem that leads to it not finding the main. After all if it compiled before, no reason it would generate a compile error now if you did not change anything in this file.
I do expect you to have some kind of versioning system by now.
Did you add a file to your makefile? The link edit step above looks suspicious. Is it more than the formatting? Are you missing a tab character? — "gcc -ggdb3 -o rom act_comm.o …"
Yeah, I do. :) But I was hopeful to figure out what I did so I don't do it again. :)
You will figure it out faster by looking at what change broke the compiling chain. Messages from compiling (especially from GCC) are often misleading. As the same 'final' message can come from multiple reasons.
Especially one that says undefined reference to main.
I've been doing some coding and started getting this error when I compiled:
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [rom] Error 1
Now, it looks like my main is right in comm.c
What could I have wrong?