home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / msdos / programm / 11838 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.7 KB  |  61 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!psinntp!ibism!ghica
  3. From: ghica@fig.citib.com (Renato Ghica)
  4. Subject: borland C++ and DLLs
  5. Message-ID: <C0GAp6.KyB@fig.citib.com>
  6. Originator: ghica@duck
  7. Sender: news@fig.citib.com
  8. Organization: Citibank IBISM
  9. Date: Wed, 6 Jan 1993 21:07:53 GMT
  10. Lines: 49
  11.  
  12.  
  13.  
  14. sorry, if this is  improper for this newsgroup, but I can't think
  15. straight anymore. Also sorry if this is an FAQ.
  16.  
  17.  
  18. DOS 5.0, WIN 3.1, BCC 3.1
  19. I'm getting very confused about how to use DLLs in a window program.
  20. I had it working once, but my brain is just about fried now.
  21.  
  22. I'm trying to compile and link a Windows program, with external routines and 
  23. classes using a "shared  library", outside of the IDE.
  24.  
  25.  
  26. 1) I compile/link all classes (defined with _export) with the -WDE flag.
  27.    A libmain procedure is included in the compile and link. This gives me
  28.    a DLL. ie
  29.  
  30.     bcc -c -P -ml -WDE -lc -lC -ls -D__cplusplus libmain.c module1.c module2.c
  31.     bcc -ml -WDE -lc -lC -ls libmain.obj module1.obj module2.obj
  32.  
  33.     RESULT : libmain.dll
  34.  
  35. 2) impdef tells me that the class methods are actuall in there, so I run rc
  36.     and then implib so as to create a .lib
  37.  
  38.     impdef foo.def libmain.dll
  39.     type foo.def (ok)
  40.     rc libmain.dll
  41.     implib myMods.lib libmain.dll
  42.  
  43. 3) I compile a main.c program which uses classes and functions defined
  44. in module1.c and module2.c
  45.  
  46.     bcc -W -P -lc -lC -ls -D__cplusplus main.c myMods.lib
  47.  
  48.  
  49.     RESULT: every reference to classes/functions in mymods.lib is UNDEFINED.
  50.  
  51. -----------------------------------------------------
  52. Does anyone know how to do this outside of the IDE? Ie getting it work?????
  53.  
  54.  
  55. Thanks
  56. -- 
  57.  
  58. "delete *this"
  59.  
  60. "These views are my own. / Mail me or Flame me"
  61.