Consultor Eletrônico



Kbase P104351: Error 3260 trying to call function in C program which was compiled using C++ compiler
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/05/2005
Status: Unverified

SYMPTOM(s):

Application calls function in DLL

DLL call worked when DLL was compiled using C compiler

Could not find the entrypoint <function>. (3260)

CHANGE:

The compiler was changed from C to C++

CAUSE:

By default C++ compilers mangle function names. This automatic mangling of the function name means that the existing 4GL code will no longer work as the function name is not going to be what one would expect it to be.

FIX:

Modify the C++ source code and add 'extern C' to the function definition then recompile the DLL. The addition of 'extern C' to the function definition tells the C++ compiler not to mangle the function name because it will be added to the export list for the DLL and will be called by non-C++ programs.