Using a MS Visual C++ DLL in Borland C++ Builder

Discussion in 'C++' started by Terry, May 31, 2006.

  1. Terry

    Terry Guest

    Is there any hope of using Borland Developer Studio 2006 to link in a
    DLL compiled by MS Visual C++ version 6? I have a Win32 DLL from a
    company named Vocera. The DLL defines C++ classes that I want to
    instantiate and use. It is not COM-compliant. It came with .dll,
    ..lib, and .h files.

    I tried using Borland C++Builder 2006, but when I add the .lib file to
    my project, I get the error: "[Linker Error] Error: 'C:\VMI.LIB'
    contains invalid OMF record, type 0x21 (possibly COFF)".

    So then I tried using the command line utilities that came with BDS.
    coff2omf (v1.0.0.74 dated 11/14/05) did generate a new .lib file but I
    still get errors like "[Linker Error] Error: Unresolved external
    'VMI::GetVersion()' ". coff2omf displayed the following "Internal
    names" but no corresponding "Imported names":

    ??0VMI@@QAE@XZ
    ??4VMI@@QAEAAV0@ABV0@@Z
    ?GetVersion@VMI@@QAEPADXZ

    So then I tried Implib (v3.0.22) to generate a new .lib file but still
    got errors like "[Linker Error] Error: Unresolved external".

    So then I tried Impdef (v3.0.22) to generate a .def file to use with
    implib to create a .lib file but then got the implib error:

    Name: 'vmi' Ext: '.dll' Base: 0x00000000
    Name: 'VMI.DLL' Ext: '.dll' Base: 0x00000000
    Error vmi.def(4): Invalid character in .DEF file

    The .def file contains lines like the following, and I think implib
    doesn't like the '?' characters:
    _??0VMI@@QAE@XZ = ??0VMI@@QAE@XZ
    ; ??0VMI@@QAE@XZ

    Finally, I tried ilink32 with the -Gi option to generate a .lib file
    but got "Error: Error processing module C:\VMI.DLL".

    I think Delphi requires a COM object to access this C++ class.

    Do I need to use a Microsoft compiler/linker?

    Thanks for your help!
    Terry
     
    Terry, May 31, 2006
    #1
    1. Advertising

  2. Terry

    mlimber Guest

    Terry wrote:
    > Is there any hope of using Borland Developer Studio 2006 to link in a
    > DLL compiled by MS Visual C++ version 6? I have a Win32 DLL from a
    > company named Vocera. The DLL defines C++ classes that I want to
    > instantiate and use. It is not COM-compliant. It came with .dll,
    > .lib, and .h files.
    >
    > I tried using Borland C++Builder 2006, but when I add the .lib file to
    > my project, I get the error: "[Linker Error] Error: 'C:\VMI.LIB'
    > contains invalid OMF record, type 0x21 (possibly COFF)".
    >
    > So then I tried using the command line utilities that came with BDS.
    > coff2omf (v1.0.0.74 dated 11/14/05) did generate a new .lib file but I
    > still get errors like "[Linker Error] Error: Unresolved external
    > 'VMI::GetVersion()' ". coff2omf displayed the following "Internal
    > names" but no corresponding "Imported names":
    >
    > ??0VMI@@QAE@XZ
    > ??4VMI@@QAEAAV0@ABV0@@Z
    > ?GetVersion@VMI@@QAEPADXZ
    >
    > So then I tried Implib (v3.0.22) to generate a new .lib file but still
    > got errors like "[Linker Error] Error: Unresolved external".
    >
    > So then I tried Impdef (v3.0.22) to generate a .def file to use with
    > implib to create a .lib file but then got the implib error:
    >
    > Name: 'vmi' Ext: '.dll' Base: 0x00000000
    > Name: 'VMI.DLL' Ext: '.dll' Base: 0x00000000
    > Error vmi.def(4): Invalid character in .DEF file
    >
    > The .def file contains lines like the following, and I think implib
    > doesn't like the '?' characters:
    > _??0VMI@@QAE@XZ = ??0VMI@@QAE@XZ
    > ; ??0VMI@@QAE@XZ
    >
    > Finally, I tried ilink32 with the -Gi option to generate a .lib file
    > but got "Error: Error processing module C:\VMI.DLL".
    >
    > I think Delphi requires a COM object to access this C++ class.
    >
    > Do I need to use a Microsoft compiler/linker?
    >
    > Thanks for your help!
    > Terry


    This question is not concerned with the C++ language proper but two
    particular implementations thereof. See this FAQ for what is on-topic
    here and for a list of possible places to post:

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

    Cheers! --M
     
    mlimber, May 31, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Piotr Karwatka

    Conversion MS VS.NET 2003 - Borland C#Builder

    Piotr Karwatka, Dec 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    371
    Kevin Spencer
    Dec 15, 2004
  2. Ziggi
    Replies:
    17
    Views:
    1,167
  3. Mark - KF8RV
    Replies:
    5
    Views:
    966
    Peter Nolan
    Jan 18, 2005
  4. Ramon F Herrera
    Replies:
    4
    Views:
    475
    =?ISO-8859-15?Q?Juli=E1n?= Albo
    Feb 5, 2005
  5. Replies:
    1
    Views:
    1,126
    SuperKoko
    Oct 2, 2006
Loading...

Share This Page