Hi,
I am trying to call an external C function:
const
ext = 'ext.lib';
function func(arg1: PChar; arg2: Longint; arg3: PChar; arg4: PChar; arg5: PChar; arg6: PPChar): Longint; cdecl; external ext;
..
rc := func(Pchar('arg1'), 0, nil, nil, PChar('arg5'), nil);
The function is behind a button click, so it is not executed on startup. When I launch the executable I always get the following error:
'ext.lib is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support'.
Now to be sure that the library is OK I created a Visual C++ project calling the same function and that works fine, but I noticed I had to add a couple of additional libraries in order to satisfy the linker.
Do I have to include these libraries as well? If so how? I tried to: add the libraries to the project, use external declarations for each library, add additional linker options, but so far nothing seems to work.
Regards,
Gijsbert