<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 14, 2017 at 9:30 AM, LacaK <span dir="ltr"><<a href="mailto:lacak@zoznam.sk" target="_blank">lacak@zoznam.sk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I have C/C++ librarby (".lib" for Windows and ".a" for Linux) from Intel IPP package (they distribute ".lib" and also ".dll" for Windows and ".a" for Linux)<br>
<br>
Can I link in FPC (on Windows) at compile time to this ".lib" versions ? Or only possible way is link at runtime using ".dll" (and distribute DLLs with my EXE)?<br>
(I guess, that FPC can not link to libraries not created in FPC itself. So format of supplied ".lib" is not compatible with what FPC expects)<br>
<br>
I am trying do something like:<br>
{$linklib libippi}<br>
function ippiThreshold_LTValGTVal_8u_C1<wbr>IR(pSrcDst: PIpp8u; srcDstStep: int;<br>
       roiSize: IppiSize; thresholdLT: Ipp8u; valueLT: Ipp8u; thresholdGT: Ipp8u;<br>
       valueGT: Ipp8u): IppStatus; external; // 'ippi.dll';<br>
<br>
(In Project Options I have path to libippi.a in -Fl)<br>
<br>
But I get error: test_IPP.lpr(24,1) Error: Undefined symbol: IPP_IPPITHRESHOLD_LTVALGTVAL_8<wbr>U_C1IR$PIPP8U$LONGINT$IPPISIZE<wbr>$BYTE$BYTE$BYTE$BYTE$$IPPSTATU<wbr>S<br></blockquote><div><br></div><div>test 1: are you on win32? If so, did you try using prefix "_"? eg:</div><div><br></div><div><div>function _ippiThreshold_LTValGTVal_8u_C<wbr>1IR(pSrcDst: PIpp8u; srcDstStep: int;<br></div><div>       roiSize: IppiSize; thresholdLT: Ipp8u; valueLT: Ipp8u; thresholdGT: Ipp8u;</div><div>       valueGT: Ipp8u): IppStatus; external;</div></div><div><br></div><div>test 2: put the library implementation below function declaration, eg:</div><div><br></div><div><div>function _ippiThreshold_LTValGTVal_8u_C<wbr>1IR(pSrcDst: PIpp8u; srcDstStep: int;<br></div><div>       roiSize: IppiSize; thresholdLT: Ipp8u; valueLT: Ipp8u; thresholdGT: Ipp8u;</div><div>       valueGT: Ipp8u): IppStatus; external;</div></div><div>{$linklib libippi}</div><div><br></div><div>fix 1: check which convention your library was compiled, supposing it was compiled supporting CDECL, you need to specify it on your Pascal binding, avoiding low-level errors at runtime:</div><div><br></div><div><div>function _ippiThreshold_LTValGTVal_8u_C<wbr>1IR(pSrcDst: PIpp8u; srcDstStep: int;<br></div><div>       roiSize: IppiSize; thresholdLT: Ipp8u; valueLT: Ipp8u; thresholdGT: Ipp8u;</div><div>       valueGT: Ipp8u): IppStatus; cdecl; external;</div></div><div><br></div><div>Anyway I've tried to use COFF objects on Windows, but I'm not sure if FPC supports that because it returns a "illegal COFF magic while reading some lib". :-/ (on Linux it works like a charm)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I am doing something wrong or just this is not possible ?<br>
<br>
Thank you<br>
-Laco.</blockquote><div> </div></div>-- <br><div class="gmail-m_-6665749015785427547gmail-m_-4815027561052506885gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div>
</div></div>