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

Error in Visual C++ program with Intel MKL BLAS routine.

satakarni_byngmail_c
449 Views

Hi All

The following is the C++ program I am trying to compile in VC++ 2005.

I got the following error :

error LNK2019: unresolved external symbol _dasum referenced in function _main

The following is my code:

#include
#include "mkl.h"
using namespace std;

int main()
{
const int n = 100;
int INCR = 1;
double A;
int i;
double result;

for(i=0; i A = (double)i;
}
result = dasum(&n, A, &INCR);
cout << result;
return 0;
}

Can someone help me to resolve the problem ?

Satakarni

0 Kudos
1 Solution
Todd_R_Intel
Employee
449 Views

What libraries have you added to your link line? For a 32-bit system something like the following could be used:

mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib

Todd

View solution in original post

0 Kudos
3 Replies
Todd_R_Intel
Employee
450 Views

What libraries have you added to your link line? For a 32-bit system something like the following could be used:

mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib

Todd

0 Kudos
satakarni_byngmail_c
449 Views

What libraries have you added to your link line? For a 32-bit system something like the following could be used:

mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib

Todd

Yeah I believe it is the problem of not linking to the libraries.

How to add libraries to the link line? (I have added MKL library path in VC++ directories.)

Can you please elobrate you explanation?

Appreciable for your valuable time.

SK

0 Kudos
Gennady_F_Intel
Moderator
449 Views

Hi Satakarni,

Hi Below you can find short description for compiling and linking program with Intel MKL v.10.0 using the Microsoft* Visual Studio* 2008 or Microsoft* Visual Studio* 2005:

  1. Select View Solution Explorer (and make sure this window is active).
  2. Select Tools Options Projects and Solutions VC++ Directories.
  3. In the drop down menu titled Show directories for:, select Include Files, and then type in the directory for the Intel MKL include files (e.g. default: C:Program FilesIntelMKL10.0include).
  4. In the drop down menu titled Show directories for: select Library Files, and then type in the directory for the Intel MKL library files (e.g. default: C:Program FilesIntelMKL10.0ia32lib).
  5. In the drop down menu titled Show directories for: select Executable Files, and then type in the directory for the Intel MKL executable files (e.g. default: C:Program FilesIntelMKL10.0ia32bin).
  6. On the main toolbar select Project Properties Configuration Properties Linker Input and in the "Additional Dependencies" line, add the libraries you require

As Todd mentioned, for a 32-bit system something like the following could be used:

mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib

For more information about Linking application with Intel MKL version 10.0 you can find in userguide.pdf chapter 5 ).

--Gennady

0 Kudos
Reply