Linking Microsoft lib's in a Borland project

Seated

Weaksauce
Joined
Nov 16, 2005
Messages
116
I'm using both C++ Builder 6.0 & RAD Studio, along with Microsoft Visual Studio 2005. Does anyone know how to link MS lib's with C++ Builder / RAD Studio? My MS product produces a DLL + LIB file, and my C++ Builder project is an EXE that needs to link to the LIB for access to the DLL at compile time.

I know MS produces COFF object files and Borland uses OMF. Borland's linker can't use/convert the COFF stuff that MS produces (I get linker errors). Any way around this?

I have done some searching on the Internet but I wanted to check here first.

Thanks!
 
There's no way around it; the formats are incompatible. Even if the formats were compatible, the semantics might not be.

Code emitted by the compiler might be dependent on the runtime libraries for things other than the functions directly called; data conversions, RTTI, floating point support, exceptions, and static data management are all features that the compiler might implement by calling functions implemented by the runtime.

Even beyond those issues, C++ compilers are free to use whatever scheme they'd like to decorate symbol names.

It's possible to build and factor your code (very carefully!) so that these problems don't become an issue. But by then, you've fallen back to only using a subset of C. Maybe you should investigate using COM for the interface in the library, if building with multiple tools is a core requirement of your project.
 
I would love to use COM or some other method to access functionality of the software I'm working with.

RImage uses MS Visual C++ for their code, and thus the libraries they build are from Visual C++. I have been using Borland's C++ Builder for years and can knock out projects really quickly. Thus, the 2 compilers.

I picked up a copy of VC++ Pro and will use that for the server-side code and C++ Builder for the client (2 programs running on 2 different computers). It'll be more work but this is better than finding the names in a VC++ produced DLL and calling this by hand.

Thanks for the help.
 
Back
Top