www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Building import libs

reply "SStallone" <sstallone gmx.de> writes:
Hi

there is a way to create import libs for every system dll you need, but at
this way you wouldn't get a header file.

Use impdef.exe to create a .def file from .dll (Borland ships it with free
BCC5.5)
Use implib.exe to create an import library.
then compile and link the source file and look what references are unsolved.
edit the .def file for the  x and reimport with implib.exe.
Now it should work.

Perhaps somebody knows how to create header files. For example for
OPENGL32.DLL???
Jul 23 2001
parent reply Cesar Rabak <csrabak uol.com.br> writes:
SStallone wrote:
 
 Hi
 
 there is a way to create import libs for every system dll you need, but at
 this way you wouldn't get a header file.
 
 Use impdef.exe to create a .def file from .dll (Borland ships it with free
 BCC5.5)
 Use implib.exe to create an import library.
 then compile and link the source file and look what references are unsolved.
 edit the .def file for the  x and reimport with implib.exe.

This recipe was already posted and commented in the borland.commndlinetools NG. Now, you know how to do this using the DM tools?
 Now it should work.
 
 Perhaps somebody knows how to create header files. For example for
 OPENGL32.DLL???

Just my .01999... I believe that from the naming conversions it is possible to create the declarations for the header files. Perhaps it could be automated with a scripting language like Python... HTH Cesar
Jul 24 2001
parent reply "SStallone" <sstallone gmx.de> writes:
 Now, you know how to do this using the DM tools?

Euh, well, yes, I know how to make them if I need them. You want to know?
 Just my .01999... I believe that from the naming conversions it is
 possible to create the declarations for the header files.

You CAN create the Functions for the header files BUT you won't get any typedefs, defines and so on..
 Perhaps it could be automated with a scripting language like Python...

good idea, but I don't know how! Best regards Chris (from Germany)
Jul 24 2001
parent reply Cesar Rabak <csrabak uol.com.br> writes:
SStallone wrote:
 
 Now, you know how to do this using the DM tools?

Euh, well, yes, I know how to make them if I need them. You want to know?

Yes please post here!
 
 Just my .01999... I believe that from the naming conversions it is
 possible to create the declarations for the header files.

You CAN create the Functions for the header files BUT you won't get any typedefs, defines and so on..
 Perhaps it could be automated with a scripting language like Python...

good idea, but I don't know how!

I believe discussing about scripting languages is somewhat off-topic in this NG. Am I correct?
Jul 25 2001
next sibling parent "SStallone" <sstallone gmx.de> writes:
Here is a short instruction how to build an import library with dmcpp-tools
although it is hard work if you don't use implib.exe that can be found in
the Borland's free compiler package. Or you can search for it on the web.

Your DLL is called FOO.DLL

    1) DUMPEXE FOO.DLL -f -i -r +e >FOO.DEF
    2) edit FOO.DEF so that you only have the names of the exports (without
quotes)
    3) add following to the first lines of FOO.DEF:
            LIBRARY FOO.DLL
            EXPORTS
            .
            .
            .
    4) now use IMPLIB FOO.LIB FOO.DEF
    5) compile and link your program with FOO.LIB
    6) look what symbols are missing (undefined)
    7) modify the FOO.DEF so that the  x suffixes are right
    8) use IMPLIB again

Better read my last postings in this newsgroup. There may be a better way to
use own created import libs.

By the way, .obj files created by the Borland compiler don't include  x
suffixes.


Scripting language sounds interesting, tell us more.


Regards
Chris
Jul 25 2001
prev sibling parent "SStallone" <sstallone gmx.de> writes:
Sorry, I forgot that you must use IMPLIB with the /s switch for adding the
underline _ to the symbols.
Jul 25 2001