Strange error message and other questions

Jeffrey A Law law@cygnus.com
Sat Dec 6 09:23:00 GMT 1997


  In message < 01bd0188$695f5f80$03010101@peter.mftinc.com >you write:
  > First of all, I downloaded the release 1.0 of egcs and built and installed
  > it successfully (make bootstrap, make install).  However, when I type the
  > command:
  > 
  > g++
  > 
  > (with no parameters)
  > 
  > I get the following messages:
  > /usr/lib/crt1.o  in function '_start'
  > /usr/lib/crt1.o (.text+0x57): undefined reference to 'main'
It should complain that it wasn't given a source file, this is a
bug in the g++ driver.

  > However, when I invoke g++ on a source file, it compiles just fine.  What
  > gives?
It needs an argument -- a file to compile.

  > My second question concerns the libraries used by egcs.  Are they
  > automatically set up in the proper directories when I do a "make install"?
  > I already had gnu g++ on my machine... is egcs still using the old
  > libraries, or does it install and reference its own?.  And if egcs does use
  > its own versions, are pointers to these set up automatically so that the old
  > ones are not referenced by accident?
Not an easy question to answer since it depends on the details of the
system you're using, how you configured the compiler, how you
invoke the compiler, and your environment variables.

In normal operation on a system with shared libraries you can get the
wrong C++ libraries because the path to the library isn't embedded
in executables.  See this link for a brief explaination of why we
don't embed library paths into executables:

http://www.cygnus.com/egcs/faq.html#rpath


jeff



More information about the Gcc mailing list