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

Confused About MKL Linking Warnings/Errors w/Visual Studio 2015

Darwen__Terence
Beginner
847 Views

Hi, I'm updating my static library from a very old version of MKL (circa ~2010) to MKL version 2019 Update 3.  I'm using Visual Studio 2015.  The only changes I made to my existing codebase was to include the new headers, change a call in my code from MKL_FreeBuffers() to mkl_free_buffers() and link to mkl_intel_c.lib, mkl_sequential.lib and mkl_core.lib as told to do by the Intel Math Kernel Library Link Line Advisor.  However, when building, I get a couple hundred warnings like this:

mkl_core.lib(_avx2_set_codelet_cb.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

But, if I no longer link in mkl_core.lib, I'll get 468 unresolved external symbols errors like this:

error LNK2001: unresolved external symbol _mkl_serv_inspector_loaded

Can anyone explain this?  Clearly it seems mkl_core.lib is needed, so I'm not sure why I'm getting those warnings...

0 Kudos
5 Replies
Gennady_F_Intel
Moderator
847 Views

did you try to build ia32 or intel64 bits project?

0 Kudos
Darwen__Terence
Beginner
847 Views

Gennady F. (Blackbelt) wrote:

did you try to build ia32 or intel64 bits project?

Hi Gennady - Thank you for the reply.  I'm building my project as "Win32" using Visual Studio 2015 (v140).

0 Kudos
Darwen__Terence
Beginner
847 Views

Anyone?  I'd love to get rid of these warnings if possible (without having to indiscriminately ignore LNK4221).  Example warning:

mkl_core.lib(_avx2_set_codelet_cb.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

0 Kudos
Gennady_F_Intel
Moderator
847 Views

The warnings happen when a static linking mode is used only. Actually, these warnings will not affect runtime behavior. Nevertheless, the issue is escalated and we will try to fix this case in one of the future releases. The only workaround we may suggest is dynamic linking mode.

0 Kudos
Gennady_F_Intel
Moderator
792 Views

The fix of this problem was added to the MKL v.2020 update 4. This update available for download.

0 Kudos
Reply