home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / aix / 13589 < prev    next >
Encoding:
Text File  |  1993-01-21  |  2.2 KB  |  47 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!newsgate.watson.ibm.com!yktnews2.watson.ibm.com!yktnews!admin!influenza!lucien
  3. From: lucien@watson.ibm.com (Lucien Van Elsen)
  4. Subject: Re: Shared Library for C++ Classes, How?
  5. Sender: news@watson.ibm.com (NNTP News Poster)
  6. Message-ID: <LUCIEN.93Jan21133018@fionavar.watson.ibm.com>
  7. In-Reply-To: dchen@vicstoy.UUCP's message of Thu, 21 Jan 1993 00:01:49 GMT
  8. Date: Thu, 21 Jan 1993 18:30:18 GMT
  9. Distribution: usa
  10. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  11. References: <1993Jan21.000149.25746@vicstoy.UUCP>
  12. Nntp-Posting-Host: fionavar.watson.ibm.com
  13. Organization: IBM T.J. Watson Research Center
  14. Lines: 31
  15.  
  16. dchen@vicstoy.UUCP (Daixiang Chen) writes:
  17. >   How to make the try.o a shared library? If the export file is need 
  18. >   (as needed for C functions) how to say 
  19. >   "export class example or export class::print" in export file format?
  20. >
  21. >   We use XL C++ 1.0, run AIX 3.2.2, I don't have the C++ compiler's user
  22.     guide. 
  23.  
  24. There is a "makeC++SharedLib" script in /usr/lpp/xlC/bin that you can use to
  25. do this.  Before using it, you'll need to create a file that contains a list
  26. of all the symbols (member function names, data object names, etc.) that
  27. will be exported to the library using /usr/ucb/nm on the .o file.  From this
  28. list, exclude all symbols that begin with a '.' and include all the virtual
  29. tables (symbols that start with __vft or __vtt) of type T, D, and B that may
  30. be used by your program.  If the library references other shared libraries,
  31. you'll need to create an import file of symbols to be resolved by the
  32. binder.
  33. Then, use 
  34. makeC++SharedLib -E export_list file.o file2.o
  35. to create the shr.o for the shared library.
  36.  
  37. I'd suggest that you get the User's Guide, by the way- not only does it give
  38. detailed instructions and examples for doing this and other obscure and
  39. useful things, but it only costs $2.62 (according to my database; pub number
  40. SC09-1472-01).  Definitely worth the price.
  41.  
  42.     -Lucien
  43. --
  44. -----------------------------------------------------------------------
  45. Lucien Van Elsen                                          IBM  Research
  46. lucien@watson.ibm.com                                     Project Agora
  47.