Thread overview
Building import libs
Jul 24, 2001
SStallone
Jul 24, 2001
Cesar Rabak
Jul 25, 2001
SStallone
Jul 25, 2001
Cesar Rabak
Jul 25, 2001
SStallone
Jul 25, 2001
SStallone
July 24, 2001
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???



July 24, 2001
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
July 25, 2001
> 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)


July 25, 2001
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?
July 25, 2001
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


July 25, 2001
Sorry, I forgot that you must use IMPLIB with the /s switch for adding the underline _ to the symbols.