Importing Borland DLL to MSVC++

A

Alex

Dear list,

I have a Dll it's .h and .lib files which have been compiled under Borland.

I followed the steps indicated to transform the lib to a lib file
readable by MSVC++

IMPDEF.EXE test.def test.dll
link /lib /def:test.def


The lib file is now accepted by the compiler. But I still get
unreferenced error link like this one

error LNK2001: unresolved external symbol "__declspec(dllimport) public:
bool __thiscall MyClass::IFC(void)" (__imp_?IFC@MyClass@@QAE_NXZ)

I searched all over google, and only found cases were there is a number
after the @ sign, but could not figure out what to do with this. I also
checked the MS KB q131313 article but it didn't create a valid lib file
(the functions were missing)

can anybody give me a hint please ?

Yours

Alex
 
M

mlimber

Alex said:
Dear list,

I have a Dll it's .h and .lib files which have been compiled under Borland.

I followed the steps indicated to transform the lib to a lib file
readable by MSVC++

IMPDEF.EXE test.def test.dll
link /lib /def:test.def


The lib file is now accepted by the compiler. But I still get
unreferenced error link like this one

error LNK2001: unresolved external symbol "__declspec(dllimport) public:
bool __thiscall MyClass::IFC(void)" (__imp_?IFC@MyClass@@QAE_NXZ)

I searched all over google, and only found cases were there is a number
after the @ sign, but could not figure out what to do with this. I also
checked the MS KB q131313 article but it didn't create a valid lib file
(the functions were missing)

can anybody give me a hint please ?

You should ask this question in a Microsoft-specific newsgroup since it
is beyond the scope of standard C++. See this FAQ for what is on-topic
here and for some suggestions of where to post:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

Cheers! --M
 
B

Bob Hairgrove

Dear list,

I have a Dll it's .h and .lib files which have been compiled under Borland.

I followed the steps indicated to transform the lib to a lib file
readable by MSVC++

IMPDEF.EXE test.def test.dll
link /lib /def:test.def


The lib file is now accepted by the compiler. But I still get
unreferenced error link like this one

error LNK2001: unresolved external symbol "__declspec(dllimport) public:
bool __thiscall MyClass::IFC(void)" (__imp_?IFC@MyClass@@QAE_NXZ)

I searched all over google, and only found cases were there is a number
after the @ sign, but could not figure out what to do with this. I also
checked the MS KB q131313 article but it didn't create a valid lib file
(the functions were missing)

can anybody give me a hint please ?

I'm afraid it won't work with C++ classes and functions because each
compiler mangles (or "decorates") the exported names according to a
different scheme. Google for "name mangling" and you'll get lots to
read about it.

Also, check out the FAQ:
http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.7
("Why is the linker giving errors for C/C++ functions being called
from C++/C functions?")
 
J

JustBoo

The lib file is now accepted by the compiler. But I still get
unreferenced error link like this one

error LNK2001: unresolved external symbol "__declspec(dllimport) public:
bool __thiscall MyClass::IFC(void)" (__imp_?IFC@MyClass@@QAE_NXZ)

This could be a Name-Mangling issue. Different compilers use different
syntax for their name-mangling schemes. Could also be project file
inclusion error (linker can't find the class). You might need to add
the correct file to the project. It's early for me and that's all I
can think of right now. :)

Good Luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top