| www.delorie.com/djgpp/faq/dev-probs/link-order.html | search |
There are two things to check here.
First, ld is a one-pass linker, it only scans each library once looking for unresolved externals it saw until that point. This means the relative position of object files and library names on the command line is significant. First, you should put all the libraries after all the object files. Second, put them in this order:
-lgpp -lgpl -lm -lpcIf you have any libraries of your own, put them before the above system libraries.
Second, some C++ functions are declared inline. However, gcc
won't inline them unless you compile with optimizations enabled, so it
tries to find the compiled version of the functions in the library.
Workaround: compile with -O.
| prev next webmaster donations bookstore | delorie software privacy |
| Copyright © 1995 by DJ Delorie | Updated Feb 1995 |