home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / g / help / 1660 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  2.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!spool.mu.edu!hri.com!enterpoop.mit.edu!thunder.mcrcim.mcgill.edu!homer.cs.mcgill.ca!archmage
  2. From: archmage@cs.mcgill.ca (Patrick Marcoux)
  3. Newsgroups: gnu.g++.help
  4. Subject: Inline: the missing link
  5. Message-ID: <C0rD3t.8pF@cs.mcgill.ca>
  6. Date: 12 Jan 93 20:33:28 GMT
  7. Sender: news@cs.mcgill.ca (Netnews Administrator)
  8. Organization: Forgive the Moose campaign international
  9. Lines: 46
  10.  
  11. I have a problem porting 'textbook' code from an HP-UX C++ (cfront) compiler
  12. to a GNU g++ one.
  13.  
  14. The problem involves the use of inlining.
  15.  
  16. The cfront accepts 2.1, and to my experience conforms to it or explicitly
  17. states otherwise in it's error messages.  It's on an HP 9000/360 running
  18. HP-UX 7.x
  19.  
  20. The  GNU is version 2.3.1, for sparc-sun-sunos4.1.  I have used it with
  21. and without the -ansi, -pedantic, -Wall flags.
  22.  
  23. The code compiles without errors or warnings.
  24. I package my object files into a library (ar rv libtk.a *.o; ranlib libtk.a).
  25. No prob.  But when I try to link it with some test code and make executables,
  26. the linker returns symbol not found errors.  All the symbols are in function/
  27. method label format.
  28.  
  29. The problem occurs when I try to link with a compilation unit whose header
  30. contains one or more of:
  31.     A) Automatically inlined friend functions
  32.         (used as per Stroustup's C++ reference manual, AT&T,
  33.          chap. 11.4 paragraph 6)
  34.         
  35.     B) (Automatically) inlined methods that call private methods
  36.     
  37.     C) Another as yet unidentified circumstance, which I believe to be
  38.        similar
  39.  
  40. In the first case, the symbols not found are those of the friend fn names
  41. themselves. By swapping code around and making things explicit, these errors
  42. disappear.  I'm still diagnosing the other cases.
  43.  
  44. All this code, the make files, everything was debugged & running smooth on
  45. the HP.
  46.  
  47. I'll try to whip up a quick & simplified example to post.  In the meantime,
  48. if this is a known and/or documented problem, or if you have ideas about
  49. what's wrong, please let me know.
  50.  
  51. P.S. Please reply by e-mail AS WELL AS post.  Thanks. 
  52. -- 
  53. ===============================================================================
  54.     Every program has at least one bug and can be shortened by at least
  55.     one instruction -- from which, by induction, one can deduce that
  56.     every program can be reduced to one instruction which doesn't work.
  57.