home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 22370 < prev    next >
Encoding:
Internet Message Format  |  1993-01-01  |  1.6 KB

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!matt.ksu.ksu.edu!news
  2. From: probreak@matt.ksu.ksu.edu (James Michael Chacon)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: G++:where is the c++ library? I couldn't link c++ program.
  5. Date: 1 Jan 1993 13:13:09 -0600
  6. Organization: Kansas State University
  7. Lines: 25
  8. Message-ID: <1i2545INNpb@matt.ksu.ksu.edu>
  9. References: <1992Dec28.134302.12378@news.ysu.edu> <C026Gw.Cqq@mach1.wlu.ca>
  10. NNTP-Posting-Host: matt.ksu.ksu.edu
  11.  
  12. kfisher3@mach1.wlu.ca (kevin fisher U) writes:
  13.  
  14. >Weijin Mai (ah214@yfn.ysu.edu) wrote:
  15. >: 
  16. >:     I compiled the C++ program and produced an object file. The problem is
  17. >: I couldn't link it with the appropiate c++ library. My program uses cout and
  18. >: cin and the linker doesn't find the library for these two functions. I used
  19. >: the -llibrary switch and tried out all the library in usr/lib without success.
  20. >: Why can't g++/gcc determine the library it needs from header file?[D[
  21. >: What is the library for iostream.h?
  22.  
  23. >I had this problem, and someone kindly enlightened me, so I will enlighten
  24. >you--compile using the -static option.  All your woes will end.
  25. >The samaritan that helped me said it was because gcc can only use the static
  26. >libraries or something.
  27.  
  28. Actually what you should do is use the -nojump option instead. This way, the
  29. shared libraries get linked in, and you don't have huge binaries in the end.
  30.  
  31. You have to use either -nojump or -static, because the g++ stuff hasn't
  32. been integrated into the jump tables as of yet. But, using the -nojump is a lot better just because of size considerations.
  33.  
  34.  
  35. James
  36.  
  37.