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

How correctly link to VML from VC++.NET console app

audrius
Beginner
1,671 Views

I've read userguide.pdf, but still I can't resolve such situation:


1. At first I create C++ Win32 console app.
2. I add #include "mkl_vml_functions.h" to my main cpp file, and a simple code:

double d1 = 0; d2;
vdCos(1, &d1, &d2);

also I include these libs Linker->Input->Additional dependencies: mkl_intel_c.lib, mkl_core.lib, libiomp5md.lib, mkl_intel_thread.lib.
3. I also copy required files to project directory: libguide40.dll, libiomp5md.dll, mkl_intel_thread.dll. Somehow itdidn't find in ..\mkl\..\ia32\bin.
4. Everything works fine!
5. Doing the same steps in C++.NET console app, I get an error:LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function __vmlCreateThreadLocalData mkl_core.lib.


One more thing:


I've tried to link dynamically: I've changed mkl_intel_c.lib, mkl_core.lib, libiomp5md.lib, mkl_intel_thread.lib TO: mkl_intel_c_dll.lib, mkl_core_dll.lib, libiomp5md.lib, mkl_intel_thread_dll.lib; but it didn't work for me: console just unexpectedly closes when calling vdCos(...); <>

What's wrong?

Thanks,

Audrius Zaukevicius

0 Kudos
2 Replies
Andrey_G_Intel2
Employee
1,671 Views


Audrius,

1) You need to link additional user32.lib library to your project

2) Add path to mkl_vml_*.dll DLLs to your PATH environment variable or copy all these DLLs to folder with your application

Thanks,

Andrey

0 Kudos
audrius
Beginner
1,671 Views


Thank you Andrey,

itdid work out.

Best regards,

Audrius Zaukevicius

0 Kudos
Reply