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

LNK2019 unresolved external symbol _DGEMM referenced in function [...]

carneiro__fernando
1,190 Views

Hi,

I want to use dgemm function from mkl lib in my (C++) program but i keep getting linking error... could you please help me with this?

I included the lib (i.e. #include "include/mkl.h"), I think it should run...

Thanks in advance...

0 Kudos
10 Replies
Gennady_F_Intel
Moderator
1,190 Views

Please take a look at the MKL_Linker_Adviser  to see how to link with Intel MKL 

0 Kudos
carneiro__fernando
1,190 Views

Could you please give me more information? I still can't link with intel MKL with those info...

- I've already manually set the path to include (.h) and lib files (at the property pages - "VC++ directories)

- then in the linker-input I added the lib names to the additional dependencies.

This link you've sent to me gave me the following info, which I don't know what to do with:
===========
Use this link line: 
 mkl_scalapack_ilp64.lib mkl_cdft_core.lib mkl_intel_ilp64.lib mkl_sequential.lib mkl_core.lib mkl_blacs_intelmpi_ilp64.lib impi.lib

Compiler options: 
 /DMKL_ILP64 -I"%MKLROOT%"\include
===========

I tried to copy the "mkl_scalapack_ilp64.lib mkl_cdft_core.lib mkl_intel_ilp64.lib mkl_sequential.lib mkl_core.lib mkl_blacs_intelmpi_ilp64.lib impi.lib" to the additional dependecies, but I get lnk1104 error "cannot open"

thanks in advance

0 Kudos
Gennady_F_Intel
Moderator
1,190 Views

You may check this article to show how to build mkl examples from VS follow this link: https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-compiling-and-linking-with-microsoft-visual-cc and We recommend you to see at the existing mkl's examples ( mklroot/examples) and check mkl_user_quide

0 Kudos
carneiro__fernando
1,190 Views

Well

It ended up that what helped me was to look for the "automatic linking" in the user guide

Now I have another problem. I can build the solution, but when I run I get the following error:

"The ordinal 242 could not be located in the dynamic link library c:\Program Files (x86)\IntelSWTolls\compilers_and_libraries_2019.4.245\windows\redist\intel64\mkl\mkl_intel_thread.dll"

Can you help me with that?

0 Kudos
Gennady_F_Intel
Moderator
1,190 Views

Do you see this dll into c:\Program Files (x86)\IntelSWTolls\compilers_and_libraries_2019.4.245\windows\redist\intel64\mkl\ directory? 

0 Kudos
carneiro__fernando
1,190 Views

Yes, mkl_intel_thread.dll is there

0 Kudos
Gennady_F_Intel
Moderator
1,190 Views

then check the paths into your system... or just put the .exe file into this \redist\intel64\mkl\ directory and try to run

0 Kudos
carneiro__fernando
1,190 Views

The path is right.

" or just put the .exe file into this \redist\intel64\mkl\ directory and try to run"

Could you explain better? Which .exe file you mean? My code doesn't have an .exe file

0 Kudos
Gennady_F_Intel
Moderator
1,190 Views

Do you see the executable file under somewhere under \x64\Debug (or Release)\ directory? 

0 Kudos
carneiro__fernando
1,190 Views

I think I've made it... don't ask me why but what I did was to change a setting from the automatic linking:

Project>Properties>Configuration Properties>Intel Performance Libraries.

Use MKL property it was selected Parallel, I changed to Sequential

Thanks

0 Kudos
Reply