FIX: problems not finding crt0.o with gcc

Martini, Emin
Mon Jun 4 08:52:00 GMT 2001

Today I installed cygwin and started fiddling with gcc.  When I tried to
compile a simple hello world program, I got an error about not being able to
find crt0.o.  Compiling with the -v flag indicated that gcc is trying to
dynamically link with the file crt0.o which is in c:/cygwin/lib.  Also I had
problems with the compiler not seeing where stdio.h and stdlib.h were
located.  I noticed other people had these problems as well by reading the
mailing list archives, but I didn't see a fix.  After some fiddling here is
the fix which worked for me.  Hopefully it will be helpful to others as
well.  I would suggest putting something about this in the FAQ since not
being able to use gcc is pretty serious.

It seems that gcc expects libraries, include files, etc. to be in /.  This
is a problem since the default setup program for cygwin makes / point to the
wrong place.  By issuing the command "mount c:/cygwin /" in bash I got gcc
to see the correct files (e.g. crt0.o, stdio.h, etc.).    

Note that you might need to fix your path in your .bashrc file to include
/bin, /usr/bin, etc. after issuing the mount command.


Want to unsubscribe from this list?
Check out:

More information about the Cygwin mailing list