home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!psinntp!ibism!ghica
- From: ghica@fig.citib.com (Renato Ghica)
- Subject: borland C++ and DLLs
- Message-ID: <C0GAp6.KyB@fig.citib.com>
- Originator: ghica@duck
- Sender: news@fig.citib.com
- Organization: Citibank IBISM
- Date: Wed, 6 Jan 1993 21:07:53 GMT
- Lines: 49
-
-
-
- sorry, if this is improper for this newsgroup, but I can't think
- straight anymore. Also sorry if this is an FAQ.
-
-
- DOS 5.0, WIN 3.1, BCC 3.1
- I'm getting very confused about how to use DLLs in a window program.
- I had it working once, but my brain is just about fried now.
-
- I'm trying to compile and link a Windows program, with external routines and
- classes using a "shared library", outside of the IDE.
-
-
- 1) I compile/link all classes (defined with _export) with the -WDE flag.
- A libmain procedure is included in the compile and link. This gives me
- a DLL. ie
-
- bcc -c -P -ml -WDE -lc -lC -ls -D__cplusplus libmain.c module1.c module2.c
- bcc -ml -WDE -lc -lC -ls libmain.obj module1.obj module2.obj
-
- RESULT : libmain.dll
-
- 2) impdef tells me that the class methods are actuall in there, so I run rc
- and then implib so as to create a .lib
-
- impdef foo.def libmain.dll
- type foo.def (ok)
- rc libmain.dll
- implib myMods.lib libmain.dll
-
- 3) I compile a main.c program which uses classes and functions defined
- in module1.c and module2.c
-
- bcc -W -P -lc -lC -ls -D__cplusplus main.c myMods.lib
-
-
- RESULT: every reference to classes/functions in mymods.lib is UNDEFINED.
-
- -----------------------------------------------------
- Does anyone know how to do this outside of the IDE? Ie getting it work?????
-
-
- Thanks
- --
-
- "delete *this"
-
- "These views are my own. / Mail me or Flame me"
-