Mail Archives: djgpp/1996/11/21/10:25:51
On Thu, 21 Nov 1996, Mordo wrote:
> You gave me an idea and here is the solution:
> In lib\specs file there is twice -lgcc. It's wrong of course; instead
> of this it should be -lstdcx to link with Standard C++ Library.
> Now it works. Thank you to give me an idea :-)Bye!
Please don't do that! This is one wrong idea that you got, and I
definitely didn't mean to tell you anything like that The file
lib/specs mentions -lgcc twice for a very good reason: some functions
from libc.a call functions from libgcc.a, while some other functions in
libgcc.a call functions in libc.a. Since ld.exe is a one-pass linker,
you must mention -lgcc both before and after -lc, or else you will get
unresolved externals in some cases. So please restore lib/specs to its
previous glory!
However, based on what you tell, I think I can guess the *real* reason
for your trouble. You are using DJGPP v2.0 (or at least gxx.exe is from
DJGPP v2.0), and that version of gxx indeed didn't include -lstdcx in the
arguments passed to the linker. So either upgrade to DJGPP v2.01 or
append -lstdcx to every link command line you pass to gxx.
- Raw text -