Importing Borland DLL to MSVC++

Discussion in 'C++' started by Alex, Jan 26, 2006.

  1. Alex

    Alex Guest

    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)" ([email protected]@@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
     
    Alex, Jan 26, 2006
    #1
    1. Advertisements

  2. Alex

    mlimber Guest

    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
     
    mlimber, Jan 26, 2006
    #2
    1. Advertisements

  3. 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?")
     
    Bob Hairgrove, Jan 26, 2006
    #3
  4. Alex

    JustBoo Guest

    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
     
    JustBoo, Jan 26, 2006
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.