• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Using third Party Supplied liabrary in Borland C++ Builder 1 or higher

I received a small .LIB file from a friend by email. This .lib file is also accompanied with a .dll file.

The read me file just stares use the supplied lib file to use the dll.

How do I merge the .lib file in my main library?


1 Solution
U cannot merge it use quick view (or any other similar tool) to see what what it contains U can ask UR friend back also for the functionality
use LoadLibrary to load the dll use its functions
this is dynamic binding U can staticall link to dll by specifying name in Project setting Link tab

Hope this helps
nils pipenbrinckCommented:
it depends on your compiler..

one option is, that you link the .lib file to your own library.. that might work (it depends on the linker).

another option you have is to split the .lib into it's object files.. since it's a dll import library there will be only one .obj file in the lib.

if you use watcom c++ (noone does these days.. only me I think) you can do this with the command wlib -x blah.lib.

with vc you can do it with lib and the /EXTRACT option.

When you have the C++ header files .. and you wish to statically link .. ensure you find out from you friend how the lib was compiled (e.g. in the code generation what run-time library) is begin used

I would follow what inpras suggested ...

Get the header file from you mate
Declare the dynamic function calls .. that is quiet easy when you have the original functions (i.e. there is a nack to it)
Use LoadLibrary

The second method is preferable as you avoid link problems and compiler dependancys

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now