ld & my Makefile

Ian Lance Taylor iant@google.com
Wed Oct 14 19:49:00 GMT 2009


Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> writes:

> I used g++ instead gcc -x c++. When i use -llibstdc++ at the end of link
> line , i receive following lines:

> /usr/bin/ld: cannot find -llibstdc++

It's -lstdc++.  But you don't need to specify it when using g++.  This
error is hiding the other errors--that is, because this error occurs,
the linker is not reporting the errors which appear when you omit that
option.


> urldump.o: In function `flushing(void*)':
> urldump.c:(.text+0xce): undefined reference to `flush_to_db(int)'

This function is not defined anywhere in your program.  It's
certainly not defined in libstdc++.  You may simple require some
extern "C" declarations, there is no way for us to know.

Ian



More information about the Gcc-help mailing list