Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

undefined reference error

tsdmilan
Beginner
303 Views

Hi,

I have some problems linking the following simple program with IPP 5.1.1 for Linux:

#include "ipp.h"

int main(int argc, char *argv[])
{
int SrcStepBytes;
Ipp8u *pSrc = ippiMalloc_8u_C1(768, 576, &SrcStepBytes);
int DstStepBytes;
Ipp8u *pDst = ippiMalloc_8u_C1(768, 576, &DstStepBytes);
IppiSize Size = {768, 576};
ippiCopy_8u_C1R(pSrc, SrcStepBytes, pDst, DstStepBytes, Size);

ippiFree(pSrc);
ippiFree(pDst);

return 0;
}

I compiled the program with the following:

g++ TestIPP.cc -I /opt/intel/ipp/5.1/ia32/include/ -L /opt/intel/ipp/5.1/ia32/lib/ -lippimerged -lippcore -O2 -o TestIPP

And I got the following errors during linking:

/tmp/cc1XpyJm.o: In function `main':
/tmp/cc1XpyJm.o(.text+0x17): undefined reference to `ippiMalloc_8u_C1'
/tmp/cc1XpyJm.o(.text+0x2f): undefined reference to `ippiMalloc_8u_C1'
/tmp/cc1XpyJm.o(.text+0x4d): undefined reference to `ippiCopy_8u_C1R'
/tmp/cc1XpyJm.o(.text+0x56): undefined reference to `ippiFree'
/tmp/cc1XpyJm.o(.text+0x5e): undefined reference to `ippiFree'
collect2: ld returned 1 exit status

I have already defined the following environment variables before linking:

LD_LIBRARY_PATH=/opt/intel/ipp/5.1/ia32/sharedlib:
IPPROOT=/opt/intel/ipp/5.1/ia32
INCLUDE=/opt/intel/ipp/5.1/ia32/include:

I have also downloaded some sample codes from the sample home page and they worked ok. Am I still missing something?

The OS I am using is RedHat 7.3.

Thanks.

Best regards,

Milan.

0 Kudos
1 Reply
Vladimir_Dudnik
Employee
303 Views

Hello Milan,

You need to link both merged and emerged libraries, where emerged libs are static dispatchers.

Regards,
Vladimir

0 Kudos
Reply