home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / g / help / 1606 < prev    next >
Encoding:
Text File  |  1992-12-18  |  1.7 KB  |  49 lines

  1. Newsgroups: gnu.g++.help
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!yale.edu!ira.uka.de!Sirius.dfn.de!tubsibr!infbssys!zeller
  3. From: zeller@ips.cs.tu-bs.de (Andreas Zeller)
  4. Subject: How can I build a sharable g++ library?
  5. Message-ID: <1992Dec17.223432@ips.cs.tu-bs.de>
  6. Sender: news@ips.cs.tu-bs.de (News Software)
  7. Nntp-Posting-Host: infbsst5.ips.cs.tu-bs.de
  8. Organization: Inst. f. Informatik, TU Braunschweig, FRG
  9. Date: Thu, 17 Dec 1992 21:34:32 GMT
  10. Lines: 37
  11.  
  12. Hi all,
  13.  
  14. I'm looking for a way to build a sharable library
  15. using g++ 2.3.2 under SunOS 4.1.1.
  16.  
  17. The "vanilla" approach (say, g++ -nostdlib -o libstuff.so.1.0 *.o)
  18. does not work, since when I'm linking (using g++ main.o -lstuff),
  19. constructors/destructors of static objects in the sharable library 
  20. are not included in the global constructor/destructor list and
  21. thus not invoked upon execution.
  22.  
  23. There is some code related to this in the 2.0 distribution
  24. of libg++ (drt0.c, init.c, init_main.c, dynamic_lib.c, dldefs.h),
  25. written by James Kempf (of SUN?), but despite all trials, 
  26. I can't figure out how to use it correctly.
  27. It seems I have to build a special object, drt0.o 
  28. (using gcc -c drt0.c or cc -pic -c drt0.c), which manages all
  29. the constructor/destructor stuff, and have it included in
  30. my shared library. This is what I do. But all I get is
  31. an "illegal instruction" error.
  32.  
  33. So, if any of you outside there have managed to build a
  34. sharable library using g++, please let me know.
  35. Any hint is appreciated. 
  36.  
  37. Please e-mail. I will summarize your suggestions.
  38.  
  39. (Andreas Zeller)
  40.  
  41. --
  42.     __o    Andreas Zeller
  43.   _`\<,_   TU Braunschweig, AG Softwaretechnologie
  44.  ( )/ ( )  Gaussstrasse 17      Tel: +49 531/391-7580  zeller@ips.cs.tu-bs.de
  45. --^----^-- D-3300 Braunschweig  Fax: +49 531/391-8111
  46.  
  47.  
  48.  
  49.