User forums > Help

How to use a DLL created by Borland C++ Builder 6?(RESOLVED)

(1/1)

kingfox:
I'm using C::B 1.0RC2 the newst nightly build and using MinGW 3.4.4 integrated within C::B.

I created a DLL named bcdll.dll by Borland C++ Builder 6. And I use followed command to generate a import library used by C::B :
   pexports bcdll.dll > bcdll.def
   dlltool -d bcdll.def -l bcdll.a
and dlltool tell that "dlltool: Syntax error in def file bcdll.dll:0".

How can I do to resolve this problem ?

The content of bcdll.def is:

--- Code: (cpp) ---LIBRARY bcDll.dll
EXPORTS
@@Bcdllfunc@Finalize
@@Bcdllfunc@Initialize
@showMessageBox$qpxc
___CPPdebugHook DATA
--- End code ---

thomas:

--- Quote from: kingfox on October 22, 2006, 11:44:22 am ---I'm using C::B 1.0RC2 the newst nightly build
--- End quote ---
Those are two mutually exclusive things.
However, it doesn't matter in this case, since it is not strictly a Code::Blocks related problem, but a compiler-related problem.

The def file that you posted contains two notable things:
1. CPP
2. double-underscores

First of all, sharing C++ libraries between different compilers is problematic at best, as they have different ABIs. You should make everything extern "C" if you want to have any chance to do cross-compiler acrobatics at all. That will force function calls to something every compiler does the same way.

Second, those double-underscores are a known issue when converting Microsoft DLLs to MinGW.
I don't know whether you can use Borland libraries in gcc at all, but these double-underscores are practically guaranteed to be the same issue as with Microsoft Dlls. The "cookbook" way to get rid of them would be pexports cbDll.dll | sed 's/^_//' > cbDll.def, as found on Mark Schoenberg's site.

If nothing helps, you may have to go through a more painful process, by editing the def file by hand to the correct format.

Pecan:

--- Quote from: thomas on October 22, 2006, 02:14:25 pm --- The "cookbook" way to get rid of them would be pexports cbDll.dll | sed 's/^_//' > cbDll.def, as found on Mark Schoenberg's site.

--- End quote ---

The site was hard to find. So I'm posting it...
http://www.emmestech.com/software/cygwin/pexports-0.43/moron1.html

kingfox:
Thank's for Thomas' and Pecan's answer. Now this problem is resolved. Thank you very much. :lol:

Navigation

[0] Message Index

Go to full version