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

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

carneiro__fernando
550 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
550 Views

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

carneiro__fernando
550 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

Gennady_F_Intel
Moderator
550 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

carneiro__fernando
550 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?

Gennady_F_Intel
Moderator
550 Views

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

carneiro__fernando
550 Views

Yes, mkl_intel_thread.dll is there

Gennady_F_Intel
Moderator
550 Views

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

carneiro__fernando
550 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

Gennady_F_Intel
Moderator
550 Views

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

carneiro__fernando
550 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

Reply