Mail Archives: djgpp/1995/01/12/01:57:03
> When trying to compile a small program (using a Makefile cause it should grow
> considerably soon) i got the following error
>
> gcc -o intro.o -c -g -Wall -Wshadow -Wconversion -Wstrict-prototypes
> -Wredundant-decls intro.c
>
> ld intro.o -o truth -Ld:/djgpp/lib -lc -lgcc
> d:/djgpp/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 000000a8
>
> ctordtor.c(.text+0x5): undefined reference to `__go32_last_ctor'
That's because you gave ld incorrect command line.
Invoking ld from a command line is not the recommended technique
for first-time users. It's best to call it via gcc driver which
will then take care of some mundane details that slipped you. For
instance in this case you forgot the crt0.o start-up code, and
also failed to mention -lgcc *before* -lc (yes, it should be
twice on the command line, both before and after -lc). You should
instead write in your Makefile this rule:
gcc -o truth intro.o
and gcc will do it for you. If you are eager to see what command
line gcc uses when calling ld, add -v to the above command line:
gcc -v -o truth intro.o
- Raw text -