Linking the MKL to a C program using stdcall

Linking the MKL to a C program using stdcall

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:

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.


4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Did you check whether mkl_s.lib uses upper case linkage?

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today