How to define the _main symbol for crt0.o?

How to define the _main symbol for crt0.o?

Post by Joseph R. Pann » Tue, 23 Feb 1993 19:25:16



I seem to recall this subject coming up before but I don't remember the
solution.  The FAQ isn't exactly answering it, either.

Anyway, if I try to make this X app by compiling with -c option first
and then linking separately, I get the error message:

/usr/lib/crt0.o: Undefined symbol _main referenced from text segment.

If I compile and link with one step, I don't get the error message.

From the FAQ I know that this crt0 has to do something with determining
what shared libs are used BEFORE the main() is called.  Is there some
header file I need to include to make my compiles and links work
separately?  I seem to recall the answer was yes, but don't recall which
header file.

Sorry if this is old hat, so please respond by e-mail if you will.

Thanks,
Joe Pannon

 
 
 

1. gcc giving error _main (multiply defined) /usr/lib/crt0.o

I was using the gcc compiler that came with yggdrasil summer '94
edition and it was working fine...  Compiled a few simple programs,
then I started getting the following error each time I try to compile
ANYTHING:

/usr/lib/crt0.o: Definition of symbol _main (multiply defined)
/tmp/cca000621.o: Definition of symbol _main (multiply defined)

This even fails on a very simple "hello world" type program.  Any
suggestions???

Thank you...

2. all

3. /usr/lib/crt0.o Undefined symbol ___fpu_control/___setfpucw

4. Shared Data/Code object creation

5. gcc #define #define #define

6. mmdf/sendmail/UUCP

7. How do I check a .a file for multiply defined symbols?

8. mounting extended DOS partitions

9. What library is this symbol defined in?

10. ld: fatal error : symbols multiply-defined

11. gcc on AIX 4.3, __malloc_postfork... symbol not defined

12. solaris,apache,mod_perl,php: Make bombs symbol `Error' is multiply defined

13. What symbols are defined in a shared lib?