Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

Simple player VS 2005 static linking problem

Last post 07-09-2008, 2:02 PM by ysong. 3 replies.
Sort Posts: Previous Next
 07-05-2008, 3:43 AM 30258324  

Simple player VS 2005 static linking problem

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
 
 07-07-2008, 11:47 PM 30258488 in reply to 30258324  

Re: Simple player VS 2005 static linking problem

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

 

 
 07-08-2008, 1:37 AM 30258496 in reply to 30258488  

Re: Simple player VS 2005 static linking problem

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
 
 07-09-2008, 2:02 PM 30258689 in reply to 30258496  

Re: Simple player VS 2005 static linking problem

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

Thanks,
Ying

 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...