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

problems with Static Linking (with dispatching)

Otto_Wesso
初学者
1,407 次查看
Hi Forum,

i want to link my application static with dispatching. So i added the needed ippxxemerged.a, ippxxmerged.a and also the ippcore.a to my build process.
But on compiling i get many linker errors on vm_shared_object_linux32 like:
obj/vm_shared_object_linux32.o: In function 'vm_so_load':
./vm_shares_objct_linux32.c:24:undefined reference to 'dlopen'

In my opinion i don't need that function if i want to link static. Whats going wrong?

The same project works with dynamic linkage on linux and also with dynamic and static linkage on Windows.
Can you tell me where my mistake is?

Thank you.

best regards
Otto
0 项奖励
1 解答
Ying_H_Intel
主持人
1,407 次查看
Hi Otto,

the undefined reference to dlopenshould be defined in system library /usr/lib/libdl.so
Maybe the eclipse environment miss it. Could you check if you have libdl.so in your machine and add -ldl inthe LIBS line? If the way still don't work. Could you please send your eclispe project to me?

I try build the vm_shared_object_linux32.c in ipp-sample/speech-codec and audio-vidoe-codec with ipp static library under linux OS and commond line. Everything looks fine.So the problem may be eclipse environment miss the system library.

Best Regards,
Ying

在原帖中查看解决方案

0 项奖励
7 回复数
Ying_H_Intel
主持人
1,407 次查看
Hi Otto,

Which IPP version are your using? is there a file named vm_shared_object_linux32 in your application?

Thanks
Ying
0 项奖励
Otto_Wesso
初学者
1,407 次查看
Hi Ying,

I use the IPP Version wich was delivered with the Intel Compiler 11.1.056 Professional. I think this is version 6.1.1.056.
And yes i linked the vm_shared_object_linux32.c file in my project.

Thanks
Otto
0 项奖励
Otto_Wesso
初学者
1,407 次查看
Is there nobody with an idea to dissolve this problem? I would be glad to have your explanation.

regards
Otto
0 项奖励
Vladimir_Dudnik
1,407 次查看
Hi Otto,

please examine how do you build VM library (which you seems to be using from IPP samples)

Regards,
Vladimir
0 项奖励
Otto_Wesso
初学者
1,407 次查看
Hi Vladimir,

thanks for your answer. I made the following settings in my .pro file (I use Eclipse and qmake to build the application):

HEADERS += ./core/vm/include/vm_shared_object.h ./... (all header files in the vm directory)

SOURCES += ./core/vm/src/vm_shared_object_linux32.c ./.. (all c files in the vm directory)

LIBS += -L/opt/intel/Compiler/11.1/056/ipp/ia32/sharedlib

LIBS += -lippac -lippch -lipps -lippsc -lippsr -lippcore -lpthread

This configuration for dynamic linking works fine, but i want to link static with dispatching. So i changed the LIB settings to:

LIBS += -L/opt/intel/Compiler/11.1/056/ipp/ia32/lib

LIBS += -lippacemerged -lippacmerged -lippchemerged -lippchmerged -lippsemerged -lippsmerged \

-lippscemerged -lippscmerged -lippsremerged -lippsrmerged -lippcore -lsvml -limf -lirc -liomp5

With this configuration i got the errors described above. The INCLUDEPATH is also stated, but i didn't listed it.

On Windows i can build static, there i use the ippcorel.lib.

I hope you can use this information and tell me what i do wrong. Thank you.

best regards

Otto

0 项奖励
Ying_H_Intel
主持人
1,408 次查看
Hi Otto,

the undefined reference to dlopenshould be defined in system library /usr/lib/libdl.so
Maybe the eclipse environment miss it. Could you check if you have libdl.so in your machine and add -ldl inthe LIBS line? If the way still don't work. Could you please send your eclispe project to me?

I try build the vm_shared_object_linux32.c in ipp-sample/speech-codec and audio-vidoe-codec with ipp static library under linux OS and commond line. Everything looks fine.So the problem may be eclipse environment miss the system library.

Best Regards,
Ying
0 项奖励
Otto_Wesso
初学者
1,407 次查看
Yes, that was my mistake!!!

I added the -ldl in the LIBS line and also changed the order of the emerged and merged libs (the ipps(e)merged has to be the last one) and it works!

Great work. Thank you very much Ying and Vladimir!!

best regards
Otto
0 项奖励
回复