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

Linking Error w/ Static Library

jwmcfar
Beginner
374 Views
When I'm attempting to use the IJL implementation of the IPP and using static linking, I receive the following compiler errors:

1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _sprintf already defined in libcmtd.lib(sprintf.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in libcmtd.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in libcmtd.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>DebugImageMerge.exe : fatal error LNK1169: one or more multiply defined symbols found

Ignoring the MSVCRT library removes all of these, and gives me:
1>ijl20l.lib(frame_encoder.obj) : warning LNK4217: locally defined symbol _sprintf imported in function _Encode_Frame_Init

We shoot for 0 warnings in our programs, so I'd like to know what I'm doing wrong and fix the remaining warning that it gives. Here's my current link order:

ippsemerged.lib
ippsmerged.lib
ippiemerged.lib
ippimerged.lib
ippjemerged.lib
ippjmerged.lib
ijl20l.lib
ippcorel.lib

Thanks,
Josh McFarlane
0 Kudos
3 Replies
Vladimir_Dudnik
Employee
374 Views

Hi Josh,

it seems for me that in your application you use CRT in DLL, but IJL was build to use CRT as static library. Can you statically link CRT to your application?

Regards,
Vladimir

0 Kudos
jwmcfar
Beginner
374 Views
Unfortunately we are using this in many MFC based applications, so we have no control over how the CRT is used.

MFC is statically linked however. Our development environment is Visual Studio .NET 2003 if that helps.
0 Kudos
Vladimir_Dudnik
Employee
374 Views

You probably can take a look on JPEGView sample which is also MFC application and can be successfully built. I hope you can find what the differences in compiler options.

Regards,
Vladimir

0 Kudos
Reply