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

Error LNK2001: unresolved external symbol _vdSin

rockballad
Beginner
654 Views
Hi all,

I have just set the first step in MKL, and faced with this problem. The same problem for Visual Studio C++ 6 and Borland C++ 2006. I just copied the source code in

c:Program FilesIntelMKL9.1.027examplesvmlcsourcevdsin.c

just to test Sin function. But it didn't work.

In VC++ 6.0: error LNK2001: unresolved external symbol _vdSin
In Borland C++: [Linker Error] Error: Unresolved external '_vdSin'

I followed the instruction in page 30 of file userguide.pdf. And add either mkl_s_dll.lib OR mkl_s.lib Or mkl_c_dll.lib OR mkl_c.lib to Object/library modules but none of them work.

Is there any step of setting I missed? Please help me. The user guild seems to be hard to understand, hic. Thanks a lot.
0 Kudos
10 Replies
rockballad
Beginner
654 Views
Addition: I'm using AMD Turion64 CPU, Windows XP SP2. 64bit is supported but I just want to use it as 32bit version. Could you please give me some advices?

Thanks in advance.
0 Kudos
Andrey_G_Intel2
Employee
654 Views
Step-by-step instruction for MS Visual Studio 6:
1) Create your own project
file -> new -> project tab -> win32 console application
enter project name and location
create EMPTY project
2) add vdsin.c file to source folder of your project workspace
3) specify additional include folders to your project
project -> settings -> C/C++ tab -> select "preprocessor" in category menu -> "additional include directories field"
you need to add two folders: folder what contains func_interv.h (it`s folder with vml C examples) and folder with MKL headers
4) add MKL libraries to linkage line
project -> settings -> Link tab -> select "general" in category menu -> "object/library modules" field
add mkl_c.lib, mkl_ia32.lib and libguide.lib libraries
5) specify additional search path for libraries to your project
project -> settings -> Link tab -> select "input" in category menu -> "additional library path" field
add path to MKL libraries (%MKL_ROOT%ia32lib) in your case
6) build your project
0 Kudos
rockballad
Beginner
654 Views
MADagilev:
Step-by-step instruction for MS Visual Studio 6:
1) Create your own project
file -> new -> project tab -> win32 console application
enter project name and location
create EMPTY project
2) add vdsin.c file to source folder of your project workspace
3) specify additional include folders to your project
project -> settings -> C/C++ tab -> select "preprocessor" in category menu -> "additional include directories field"
you need to add two folders: folder what contains func_interv.h (it`s folder with vml C examples) and folder with MKL headers
4) add MKL libraries to linkage line
project -> settings -> Link tab -> select "general" in category menu -> "object/library modules" field
add mkl_c.lib, mkl_ia32.lib and libguide.lib libraries
5) specify additional search path for libraries to your project
project -> settings -> Link tab -> select "input" in category menu -> "additional library path" field
add path to MKL libraries (%MKL_ROOT%ia32lib) in your case
6) build your project


Thank you very much for your very detailed instruction! The error above doesn't appear any more, but there's a new error:

"fatal error LNK1000: unknown error; consult documentation for technical support options"

I've tried other source file, copy func_interv.h to project directory, double check your instruction, but got no success. Could you tell me how to deal with this problem, we're going to reach the target. Thanks again!
0 Kudos
Andrey_G_Intel2
Employee
654 Views

Are you installed MSVS 6 correctly?

Try to use MSVS 2005.

0 Kudos
rockballad
Beginner
654 Views
Thanks! I'm going to tell you that I got success with VS2005! The network here is so slow, I can't post any reply. Hope this time it's ok.

Now I'm trying to use in Borland C++ 2006, it's the IDE I'm working on. Do you have any experience with it, MADagilev?

I don't know how to add lib files (mkl_c.lib mkl_ia32.lib libguide.lib), so I add these files directly, the project must be too big (because mkl_ia32.lib is so big). Now the error I get is:

[Linker Error] Error: 'C:PROGRAM FILESINTELMKL9.1.027IA32LIBMKL_IA32.LIB' contains invalid OMF record, type 0x21 (possibly COFF)

I think I may add file MKL_IA32.LIB unsuccessully (it might be corrupted). So could you tell me how to add lib files just as in VC++ 6 or VS2005 (specify lib filename, not to add directly) ?

Please take a look and give me some advices. Thank you so much!

Best regards,

0 Kudos
rockballad
Beginner
654 Views
All right, I figured it out. The problem is lib file from MS is different from Borland. So I'm about to use IMPLIB.EXE utility to make lib file for Borland.

But I need the corresponding dll files! Could you show me where these dll files, e.g. mkl_s.dll, mkl_ia32.dll,... are? Or how can I generate these dll files from your lib files? And then I will do my part?

Thanks again!
0 Kudos
Andrey_G_Intel2
Employee
654 Views
About what DLL files are you talking? When you use mkl_c.lib and mkl_ia32.lib you don`t need any _MKL_ DLLs because all needed stuff linked to your application staticaly.
0 Kudos
rockballad
Beginner
654 Views
Yes, I guess so. But the problem is I can't use those lib files (for Borland).

I need proper dll files, from that I can generate lib fiels (for Borland).

But I don't have the corresponding file (e.g. "mkl_c.dll", "mkl_ia32.dll" in order to get "mkl_c_borland.lib" and "mkl_ia32_borland.lib", and so on).

One thing for sure is that I can't use the available .lib files (in ia32lib).

I need to take advantage of DLLs file, is that any way? How about dynamic linking? Or a wrapper? My friend tellls me to use

#ifdef __cplusplus
extern "C" {
#endif

but I'm not very sure of it.

Could you tell me how to use in dynamic linking? Thanks so much. I highly appreciate your help!

0 Kudos
Andrey_G_Intel2
Employee
654 Views

Ok. I understand your problem. You are trying to build import libraries for our DLLs.

In MKL we have statical interface libraries (for Windows) for dynamical computation libraries. I.e. if you are want to link MKL dynamical libraries you should use mkl_c_dll.lib or mkl_s_dll.lib libraries from %MKL_ROOT%ia32lib. This libraries automaticaly load the best DLL library for you CPU (from %MKL_ROOT%ia32dll folder).

The problem is what in case of VML&VSL it`s prohibited to use processor specific DLLs directly (via LoadLibrary or via imp lib).

And looks like in MKL we don`t support compilers from borland. Forlist of supported compilers see http://www.intel.com/software/products/mkl/docs/mklnotes_win.htm.

PS: my name is Andrey :-)

0 Kudos
rockballad
Beginner
654 Views
Thank you very much, Andrey! Hope you don't stay up late to help me solve that problem.

The way MKL work looks interesting! But it's so sad that Borland can't take advantage of it.

But, wait a minute. If we use the C++ compiler, it's no matter what IDE is used, is it right? If we can't use dynamically like that, how about the wrapper? I also notice that all header files have "#ifdef __cplusplus extern "C" { #endif ........" already. Why does it not work :-?

Look like I'll have to work with MKL this weekend. If you have any suggestion, please tell me. Thanks for helping me!

Take care,

0 Kudos
Reply