Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7222 Discussions

VS2005 linking problem: warning LNK4003: invalid library format; library ignored

Intel_C_Intel
Employee
2,744 Views

Dear Experts! :)

I am trying to integrate MKL into an existing project (.dll), trying to use FFT and other algorithms later (currently using an eval version, waiting deciding on buying later).

I tried to copy some of the code from the examples, and also set the project options accordingly, but so far without success.

I have added both the lib and the include directory to the project settings. Since I want to link statically, I have not added the bin directory (I dont need it?!).

After trying a bit and not finding a solution, I found libmkl_ms_thread.lib as a candidate for inclusion, but could not find the library in my installation.

So right now, I have this code at the beginning of my file

#ifdef

_INCLUDE_INTEL_MKL_

#include

"mkl_dfti.h"

//#pragma comment( lib, "mkl_core.lib" )

//#pragma comment( lib, "mkl_intel_thread.lib" ) // support ms compiler threading

#pragma

comment( lib, "mkl_sequential.lib" )

#pragma

comment( lib, "mkl_c.lib" ) // cdecl version

//#pragma comment( lib, "mkl_cdft_core.lib" )

#pragma

comment( lib, "mkl_cdft.lib" )

// mkl_core.lib

#include

"mkl_types.h"

#endif

I then use those functions later in my code. Unfortunately, I get the following errors:

1>S:intelia32libmkl_c.lib : warning LNK4003: invalid library format; library ignored

1>S:intelia32libmkl_cdft.lib : warning LNK4003: invalid library format; library ignored

1> Creating library ..outputdebugsaturnmath.lib and object ..outputdebugsaturnmath.exp

1>S:intelia32libmkl_c.lib : warning LNK4003: invalid library format; library ignored

1>S:intelia32libmkl_cdft.lib : warning LNK4003: invalid library format; library ignored

1>.obj : error LNK2019: unresolved external symbol _DftiFreeDescriptor referenced in function "double __cdecl fft(double *,int,double *)" (?fft@@YANPANH0@Z)

1>.obj : error LNK2019: unresolved external symbol _DftiComputeBackward referenced in function "double __cdecl fft(double *,int,double *)" (?fft@@YANPANH0@Z)


I have the library installed locally, and then copied the include and lib folders to a network path (s:).

Do you have any idea? I am completely lost!

I am usin g Visual Studio 2005SP1 (c++) and MKL10.0.1.015.

Best regards

0 Kudos
4 Replies
andipandi
Beginner
2,744 Views

I have extracted the MKL-setup file, extracted the .cab file, and made a binary comparison with the mkl_c.lib file. It was the same. Then I did a repair-install to the local HD, and changed the paths in the project to also use the local install.

No change.

What's wrong?

Now I have changed the pragmas to

#include "mkl_dfti.h"

// mkl_c.lib:

//#pragma comment( lib, "mkl_c.lib" ) // cdecl version

#pragma

comment( lib, "mkl_intel_c.lib" ) // cdecl version

#pragma

comment( lib, "mkl_intel_thread.lib" ) // cdecl version

#pragma

comment( lib, "mkl_core.lib" ) // cdecl version

// mkl_cdft:

//#pragma comment( lib, "mkl_cdft.lib" )

#pragma

comment( lib, "mkl_cdft_core.lib" )

#pragma

comment( lib, "libguide.lib" )

#include

"mkl_types.h"

And everything works fine. No idea why, but it seems like the combined libraries are not working for me?!

Also, is the libguide.lib the right version to use?

0 Kudos
TimP
Honored Contributor III
2,744 Views
If I understand you correctly, you needed mkl_core.lib, but when you omitted it, the error messages weren't what would be expected.
It's not clear to me whether you had trouble with sequential.lib.
libguide was recommended to me for use with thread.lib, if you aren't interested in compatibility with VC9 OpenMP (libiomp). Either OpenMP library will work.
0 Kudos
andipandi
Beginner
2,744 Views

Thx for your reply!

I think the problem was with the combined libraries (the ones containing several others) that VS2005 did not properly recognize.

Also, I am at a loss at which lib to include if I want to automatically use all cores included in the system. Does it come down to just including the right .lib or do I have to do anything specific to use several threads and an appropriate algorithm?

0 Kudos
TimP
Honored Contributor III
2,744 Views
When you link mkl_intel_thread, an algorithm is applied to optimize the number of threads to the size of the problem. If you wished to optimize to solve a number of similar size problems in parallel, it might be better to write your own explicit OpenMP loop to achieve that goal.
0 Kudos
Reply