home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3899 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.7 KB

  1. Path: sparky!uunet!vnet.ibm.com
  2. From: dmm@vnet.ibm.com (dave)
  3. Message-ID: <19920730.091826.460@almaden.ibm.com>
  4. Date: Thu, 30 Jul 92 12:12:01 EDT
  5. Newsgroups: comp.os.os2.programmer
  6. Subject: Re: Help! Need to link 16bit LIB with 32bit Application
  7. Organization: IBM Canada Lab
  8. News-Software: UReply 3.0
  9. X-X-From: dmm@vnet.ibm.com (Dave Mooney)
  10. References: <anderson.16.712435941@mayo.edu>
  11. Lines: 43
  12.  
  13. In <anderson.16.712435941@mayo.edu>  Alfred I. Anderson writes:
  14. > Sybase distributes a .LIB file that is linked in with a C appliaction to
  15. > allow access to their data base on the network.  Apparently it is not
  16. > possible (?) to link this file against an application developed with the IBM
  17. > CSet/2 compiler in 32 bit mode??
  18. >
  19. > Does anyone have a suggestion how we can link to this 16bit LIB??
  20.  
  21. You should probably get a list of the entry points in the library, list
  22. these entry points in the EXPORTS sections of the .DEF file, and then
  23. link the library as a .DLL.  That is, if the library exports the entry
  24. points foo() and bar() (with the _pascal calling convention), write a
  25. .DEF file SYBASE.DEF:
  26.  
  27.   LIBRARY SYBASE
  28.   EXPORTS
  29.     FOO @1
  30.     BAR @2
  31.  
  32. and a .DEF file MAIN.DEF:
  33.  
  34.   NAME MAIN
  35.   IMPORTS
  36.     FOO    =SYBASE.1
  37.     BAR    =SYBASE.2
  38.  
  39. Link the .DLL as
  40.  
  41.   link386 sybase.lib,sybase.dll,,,sybase.def
  42.  
  43. and your .EXE as
  44.  
  45.   link386 main,main.exe,,,main.def
  46.  
  47. The syntax may be off a bit here and there, but I have used this method
  48. successfully before.
  49.  
  50. dave
  51.  
  52. -------------------------------------------------------------------------
  53. Dave Mooney                                              dmm@vnet.ibm.com
  54.  C Set/2 Development, IBM Canada Lab, 844 Don Mills Rd, Toronto, Ontario
  55.             "If you've got a blacklist, I want to be on it"
  56.