From: probreak@matt.ksu.ksu.edu (James Michael Chacon) Subject: Re: G++:where is the c++ library? I couldn't link c++ program. Date: 1 Jan 1993 13:13:09 -0600
kfisher3@mach1.wlu.ca (kevin fisher U) writes:
>Weijin Mai (ah214@yfn.ysu.edu) wrote:
>:
>: I compiled the C++ program and produced an object file. The problem is
>: I couldn't link it with the appropiate c++ library. My program uses cout and
>: cin and the linker doesn't find the library for these two functions. I used
>: the -llibrary switch and tried out all the library in usr/lib without success.
>: Why can't g++/gcc determine the library it needs from header file?[D[
>: What is the library for iostream.h?
>I had this problem, and someone kindly enlightened me, so I will enlighten
>you--compile using the -static option. All your woes will end.
>The samaritan that helped me said it was because gcc can only use the static
>libraries or something.
Actually what you should do is use the -nojump option instead. This way, the
shared libraries get linked in, and you don't have huge binaries in the end.
You have to use either -nojump or -static, because the g++ stuff hasn't
been integrated into the jump tables as of yet. But, using the -nojump is a lot better just because of size considerations.
James