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.
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++
.libfile in BCB at all, as.libfiles are compiler-specific.If the VC++
.libis a static library, you would have to recompile the library's source code using BCB's compiler.If the VC++
.libis an import library for a DLL, can create a new BCB-compatible import.libfile, by using either:BCB's COFF2OMF tool to convert the VC++
.libfile itself into a new file in BCB's OMF format.BCB's IMPLIB tool, which can create a new
.libfile from the DLL itself.