0

How can I import a VS2005 DLL in Borland C++ Builder?

We have an VS2005 DLL with many legacy code that will not be easily compiled in C++ Builder, and we have a client using Borland C++.

There is any way to build this DLL using OMF format?

Victor
  • 8,309
  • 14
  • 80
  • 129
  • [First google hit](http://bcbjournal.org/articles/vol4/0012/Using_Visual_C_DLLs_with_CBuilder.htm). – Hans Passant Nov 25 '14 at 14:55
  • @Victor use `implib.exe` to create lib file for the DLL you will find it in borland bin directory. play with switches, sometimes you need to use the switches to get the DLL work. If everything fails (happens if DLL is too foreign) then you need to use dynamic linking instead of static (but usually for those DLL is the windows linking API not working properly either ...) PS. if the DLL is 64bit and your app 32bit then you need some wrapper for WOW64 ... – Spektre Nov 25 '14 at 15:37
  • @Victor Also header files from MSVCPP sometimes need to add some define or include to work – Spektre Nov 25 '14 at 15:44
  • I used `implib` and the result was: `000000 MSLIBR Index begins at file offset 200. Index is 1 blocks. 000010 MSLEND` I believe something was wrong – Victor Nov 25 '14 at 16:02
  • @Victor: That is not something that `implib` should be outputting for a DLL. `tdump` can output that for a LIB file, though. – Remy Lebeau Nov 26 '14 at 01:54
  • @Victor is it possible that the dll is 32-bit, and the client is using 16-bit Borland C++? – Jogy Dec 02 '14 at 06:21
  • @Victor here some examples ... `implib.exe -c -f -a cg.lib cg.dll`,`implib.exe -c -f -a cgGL.lib cgGL.dll`,`implib.exe -c -f -a glut32.lib glut32.dll` I am using implib from BDS2006 so from newer BCB like XE7 there can be changes in switches run it in cmd and use its help switch to elaborate. Also try your DLL in some PE explorer or DLL export viewer to see what the file really is (16/32/64 bit, included exports,...). You did not add the `@nick` at the start of the comment so I was not notified of new comment ... – Spektre Dec 02 '14 at 07:34

0 Answers0