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

Simple player VS 2005 static linking problem

gossamer
Beginner
386 Views
I'm trying to convert Simple_player to use static library linkage (visual studio 2005) and i have problem with two projects.

Every lib from simple_player was converted to single project file (h264_dec, vcl_spl, mp3_dec ...), so i have rebuild all projects to use w7_ipp* version of procedures. Also, i've include all ipp*emerged.lib and ippcorel.lib in main project. So when i rebuild those projects they generate .lib files and doesnt produce any error messages. But when i try to rebuild main project (simple_player) i get 4 unresolved external error messages.

jpeg.lib(jpegdec.obj) : error LNK2001: unresolved external symbol _w7_ippMalloc@4
jpeg.lib(jpegdec.obj) : error LNK2001: unresolved external symbol _w7_ippFree@4
jpeg.lib(decqtbl.obj) : error LNK2001: unresolved external symbol _w7_ippAlignPtr@8
vc1_dec.lib(umc_vc1_dec_seq.obj) : error LNK2001: unresolved external symbol _w7_ippStaticInit@0

I've put definitons for IPPCALL at begining of jpegdec.cpp file and slightly redefined ippdefs.h file as
...
#if defined (STATIC_PROC_W7)
#define IPPAPI(type,name,arg) extern type __STDCALL w7_##name arg;
#else
#define IPPAPI( type,name,arg ) extern type __STDCALL name arg;
#endif
#endif
...
So i use preprocessor definition STATIC_PROC_W7 in project configuration.
Next thing i was trying to do:
Because i couldnt find w7_ippMalloc in ippcorel.lib file i've redefined procedures calls as:
//----------------------
#define w7_ippMalloc ippMalloc
#define w7_ippFree ippFree

#define OWN_IPPAPI( type,name,arg ) extern type __STDCALL name arg;
OWN_IPPAPI( void*,ippMalloc, (int length) )
OWN_IPPAPI( void, ippFree, (void* ptr) )
//--------------------

I've use that because i didnt want to mess with other w7_ipp* functions calls (as linker havent complained at them) .. now IPPCALL definition change ippMalloc to w7_ippMalloc which is changed back to ippMalloc by my definition. So in the end it produces:

extern void * __stdcall ippMalloc(int)
again, compiling jpeg project didnt produce any errors, but compiling main project produces following
jpeg.lib(jpegdec.obj) : error LNK2001: unresolved external symbol "void * __stdcall ippMalloc(int)" (?ippMalloc@@YGPAXH@Z)
jpeg.lib(jpegdec.obj) : error LNK2001: unresolved external symbol "void __stdcall ippFree(void *)" (?ippFree@@YGXPAX@Z)
...
I have no idea what else to try, hope You could help me figure this out.


Sincerely,
Sven
0 Kudos
3 Replies
Ying_S_Intel
Employee
386 Views

You may add extern "C" ... to the declartions to make ippMalloc and ippFree C functions.

In general, the include files provided in Intel IPP are not subject to modify.

Thanks,

Ying

0 Kudos
gossamer
Beginner
386 Views
Hi,

That helped, thanx.
About include files, i will use #undef instead of editing files, but that could lead to a problem if some of the header files call that function before my redefinition. It would be a good idea to put definition for static linkage in ippdefs.h


Sven
0 Kudos
Ying_S_Intel
Employee
386 Views

Simply, you can include ipp_w7.h before ipp.h.

Thanks,
Ying

0 Kudos
Reply