Archicad C++ API
About Archicad add-on development using the C++ API.

__fastcall issue?

Anonymous
Not applicable
Using the rendering API I bumped into the following problem:

To use the FreeImage library I include its header and link its .lib file. The whole library uses __cdecl. It has function names like this:
FreeImage_Save(...)

In the .lib it looks like this:
_FreeImage_Save@16

But when I try to build my project the linker says it cannot find the implementation for the function named:
_FreeImage_Save

(I am pretty sure it doesn't have to do with the extern "C" thing. )

Any solutions would be very welcome.

Chrispy
3 REPLIES 3
Oleg
Expert
_FreeImage_Save@16
It looks like __stdcall name decoration.

Is the functions in the header file of FreeImage library decrared
like __stdcall FreeImage_Save(...) or just FreeImage_Save(...) ?
Anonymous
Not applicable
The header files are simply FreeImage_Save(...)

Why does the linker search for _FreeImage_Save() ?
Oleg
Expert
Is the FreeImage libarary from sourceforge ?

I have just downloaded it. The header file declaration is
DLL_API BOOL DLL_CALLCONV FreeImage_Save()

DLL_CALLCONV should be __stdcall. Make sure you project has
defined WIN32 macro and NOT defined FREEIMAGE_LIB and __WIN32__
( it is at the begin of the FreeImage.h header )