On 3/16/2017 12:01 PM, LacaK wrote:
Then I get:
  test_IPP.lpr(17,1) Error: undefined reference to `ippGetLibVersion'
(I have tried also: _ippGetLibVersion, _ippGetLibVersion@0 ...)

I've downloaded the IPP libs and did some tests to make sure that static linking is possible.

The working declaration is:

{$L ippcoremt.lib}
function ippGetLibVersion: PIppLibraryVersion; cdecl; external name 'ippGetLibVersion@0';

You need to use the external linker via the -Xe option, since internal linker does not support static libraries. Only single object files can be linked.

ippGetLibVersion@0 - is the C++ mangled name used by MS VC++. FPC supports then "cppdecl" calling convention, but only for the GCC compiler, which uses different name mangling algorithm. So you need to use cdecl and manually specify the name. Function names can be found using "objdump -t ippcoremt.lib". You should specify the name without the "_" prefix. It is added automatically when cdecl is used.

Yury.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to