Game Ray
Game Ray

Reputation: 1

Convert VC++ library using namespace to BCB6

VC++ code:

namespace Test { class __declspec(dllexport) A { public: void foo(); }; }

Took from library compiled in MS VC++:

A@Test@

The same in BCB6 C++:

@Test@A

What is it connected with?

What compiler options to set to record the namespace in front of the class? Because of this, BCB6 cannot link the library.

Searched on Google but didn't find anything.

Upvotes: 0

Views: 168

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 596206

Different compilers decorate/mangle exported symbols differently. There is no option to make BCB's compiler decorate/mangle its symbols the same way that VC++ does, and vice versa.

In any case, you can't use a pre-compiled VC++ .lib file in BCB at all, as .lib files are compiler-specific.

If the VC++ .lib is a static library, you would have to recompile the library's source code using BCB's compiler.

If the VC++ .lib is an import library for a DLL, can create a new BCB-compatible import .lib file, by using either:

  • BCB's COFF2OMF tool to convert the VC++ .lib file itself into a new file in BCB's OMF format.

  • BCB's IMPLIB tool, which can create a new .lib file from the DLL itself.

Upvotes: 1

Related Questions