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

Linking the MKL to a C program using stdcall

jdmajsm
Beginner
657 Views
Hi,
I just downloaded the MKL in order to test it.

I have a very simple DLL project that I wrote in
Visual Studio 6.0 C/C++.

The program tries to calls the function dgetrf from
the LAPACK library.

I can compile the code. I can also link it when
I use the cdecl calling convention in the project
settings, and add mkl_c.lib to the object/library modules
in the input section of the link section of the settings.

However when I try to compile the stdcall call convention
and replace mkl_c.lib with mkl_s.lib in the link section
of the settings, I can get this error:

Linking...
Creating library Release/mytests.lib and object Release/mytests.exp
HFTestRoutines.obj : error LNK2001: unresolved external symbol _dgetrf
../lib/mytests.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

mytests.dll - 2 error(s), 0 warning(s)

I take it that the error means that Visual Studio C/C++ cannot
find the function.

I need to compile using stdcall rather than cdecl. Does anyone
have any suggestions about what might be causing this problem
and how I could fix it?

Many Thanks in advance.

Jeff
0 Kudos
3 Replies
TimP
Honored Contributor III
657 Views
Did you check whether mkl_s.lib uses upper case linkage?
0 Kudos
jdmajsm
Beginner
657 Views
Thanks Tim. In fact, I just tried this and was about to report
that changing lower to upper case solved the problem
but you beat me to it! Many thanks for your help. Jeff
0 Kudos
Intel_C_Intel
Employee
657 Views
 
0 Kudos
Reply