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

Undefined Reference Error

sudarshan_gopinath
802 Views
I have installed the Intel IPP library and its installation path is:
/opt/intel/ipp41/em64t/

I have a function addRunLat.cpp that uses some of he functions in the library. However when I get the following error on doing a make operation -

g++ findCorrsForImg.cpp -c
g++ getFeatForCorr.cpp -c
g++ main.o readData.o frameLoc.o addRunLat.o registerImage.o findCorrsForImg.o getFeatForCorr.o -lm -o main
addRunLat.o(.text+0x393): In function `addRunLat(frameLoc*, int, int, int, tFormMatrix*, int, int)':
: undefined reference to `ippiGetAffineQuad'
addRunLat.o(.text+0x594): In function `addRunLat(frameLoc*, int, int, int, tFormMatrix*, int, int)':
: undefined reference to `ippmInvert_m_32f_3x3'
addRunLat.o(.text+0x5b4): In function `addRunLat(frameLoc*, int, int, int, tFormMatrix*, int, int)':
: undefined reference to `ippmInvert_m_32f_3x3'
addRunLat.o(.text+0x5fd): In function `addRunLat(frameLoc*, int, int, int, tFormMatrix*, int, int)':
: undefined reference to `ippmMul_mm_32f_3x3'
addRunLat.o(.text+0x62c): In function `addRunLat(frameLoc*, int, int, int, tFormMatrix*, int, int)':
: undefined reference to `ippmMul_mm_32f_3x3'
addRunLat.o(.text+0x742): In function `addRunLat(frameLoc*, int, int, int, tFormMatrix*, int, int)':
: undefined reference to `ippiGetAffineQuad'
registerImage.o(.text+0xbb): In function `registerImage(Image*, frameLoc*, int)':
: undefined reference to `addRunLat(frameLoc*, int, int, tFormMatrix*, int, int)'
collect2: ld returned 1 exit status
make: *** [main] Error 1


The exact line in my Makefile for addRunLat is:
addRunLat.o:addRunLat.cpp classdec.h
g++ -I/opt/intel/ipp41/em64t/include -L/opt/intel/ipp41/em64t/lib -l addRunLat.cpp -c

I need to get this issue resolved as soon as possible...please help me out. this is the first time I'm working with the Intel IPP libraries.
0 Kudos
5 Replies
Vladimir_Dudnik
Employee
802 Views
Hi,
seems you did not specified which IPP libraries to link. As I can see you only specified path where linked should look for them.
Regards,
Vladimir
0 Kudos
rchatrat
Beginner
802 Views
Hello vdudnik!!

How do I do it?? I am currently using "ippmMul_mm_32f_3x3" function which is located in ippm.h header file. Did u mean I have to specify the file name in the Makefile as below:


addRunLat.o:addRunLat.cpp classdec.h
g++ -I/opt/intel/ipp41/em64t/include -L/opt/intel/ipp41/em64t/lib/ippm.h -l addRunLat.cpp -c


This didn't solve the error. Is that allowed? Kindly bare with me if this is a trivial question. I am new to both Intel IPPs and C++, and Makefiles too.

And what do I have to mention in the Makefile rule for main:

main:main.o readData.o frameLoc.o addRunLat.o copyPartial.o maskFFT.o registerImage.o findCorrsForImg.o getFeatForCorr.o
g++ main.o copyPartial.o maskFFT.o readData.o frameLoc.o addRunLat.o -lm -lfftw3 -L/opt/intel/ipp41/em64t/lib registerImage.o findCorrsForImg.o getFeatForCorr.o -o main

would the above lines suffice? can you suggest some tutorials on these topics.

Thanks in advance.

P.S: Sudarshan and I are working on the same project.

Thanks and Regards,
Rajesh
0 Kudos
Vladimir_Dudnik
Employee
802 Views
Hi Rajesh,
you are talking about specifying path where compiler will look for C/C++ header files. But you also need to specify linker which libraries to link iinto your application. Keeping in mind that order of libraries is imprtant on Linux you need to add something like that: -lippm -lipps -lippcore.
BTW, you can downalod any IPPsample for Linux to look how Makefile should looks like.
Regards,
Vladimir
0 Kudos
rchatrat
Beginner
802 Views
Hello vdudnik,
thanks for the response.
I tried with your suggestion, but the error persists. I tried with the following rules:
main.o readData.o frameLoc.o addRunLat.o registerImage.o findCorrsForImg.o getFeatForCorr.o -lm -o main -L/opt/intel/ipp41/em64t/lib -lippm -lippi -lippcore
main.o readData.o frameLoc.o addRunLat.o registerImage.o findCorrsForImg.o getFeatForCorr.o -lm -o main -l/opt/intel/ipp41/em64t/lib -lippm -lippi -lippcore
then i checked for these libraries at the path mentioned and found these libraries instead.
libippmemergedem64t.a
libippmergedem64t.a
libippacemergedem64t.a
libippacmergedem64t.a
........
.....
I then added modified the rule including all the libraries in the directory as
main.o readData.o frameLoc.o addRunLat.o registerImage.o findCorrsForImg.o getFeatForCorr.o -lm -o main -L/opt/intel/ipp41/em64t/lib -lippmemergedem64t -lippmergedem64t -lippacemergedem64t ......... ....
I found some libraries in the sharedlib directory and then tried them too, but in vain....

thanks in advance
regards,
rajesh
0 Kudos
Vladimir_Dudnik
Employee
802 Views

Hi Rajesh,

I'm sorry for delay, was too busy last days:(

I did not realized you are use EM64T based system.That's correct, we are use different prefixes(postfixes) to distinguish libraries for different platfroms. They are obvious though, for example

1. Nothing for IA32 platform, so name of dispatcher shared library for ippIP will be libippi.so
2. em64t postfix for EM64T platform, so the same library will have name libippiem64t.so
3. 64 for Itanium. In this case naem of the same library will be libippi64.so

Did you took a look on existing IPP samples? It is easier to look on existing Makefiles to see what might be wrong in way you are doing.

Regards,
Vladimir

0 Kudos
Reply