[fpc-devel] Staticaly link C/C++ library (.lib) into FreePascal on Windows

Yury Sidorov jura at cp-lab.com
Thu Mar 16 12:42:30 CET 2017


On 3/16/2017 1:12 PM, LacaK wrote:
>
>>> Then I get:
>>>   test_IPP.lpr(17,1) Error: undefined reference to `ippGetLibVersion'
>>> (I have tried also: _ippGetLibVersion, _ippGetLibVersion at 0 ...)
>>
>> I've downloaded the IPP libs and did some tests to make sure that
>> static linking is possible.
> Thank you very much for your effort!
> You use cdecl, but in header files is stated stdcall for Windows, isn't
> it problem ?

You are right. The headers use stdcall. You need also use stdcall and 
add "_" before names - use the same names as reported by objdump.

function ippGetLibVersion: PIppLibraryVersion; stdcall; external name 
'_ippGetLibVersion at 0';

> Besides that it does not work for me, when I add another two functions.
> Attached my example.
>
> I get error:
> .\Intel_IPP\\ippcoremt.lib(C:/commander/production/ipp201702gold/windows_ia32/.build/windows/obj/ia32/core/s/st/owncpufeatures.obj):(.text[_ownGetMaskFeatures]+0x35):
> undefined reference to `__security_cookie'

Looks like you need to include the bufferoverflow.lib

See here:
http://stackoverflow.com/questions/21627607/gcc-linker-error-undefined-reference-to-security-cookie

Yury.



More information about the fpc-devel mailing list