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

Problem Running C++ Example in the user guide

thefell
Beginner
1,100 Views

Hi all,

I'm just getting started with MKL, and I'm having some trouble running the examples in the user guide. I'm using Visual C++ 2005 (express), and have followed the directions in the guide regarding the Configuration of my Development envirornment. I am have installed MKL 9.1.027. Any help would be very much welcome.

Thanks,

TheFell

#include

#include

"mkl.h"

typedef

struct{ double re; double im; } complex16;

extern

"C" void zdotc (complex16*, int *, complex16 *, int *, complex16

*,

int *);

#define

N 5

void

main()

{

int

n, inca = 1, incb = 1, i;

complex16 a, b, c;

n = N;

for

( i = 0; i < n; i++ ){

a.re = (

double)i; a.im = (double)i * 2.0;

b.re = (

double)(n - i); b.im = (double)i * 2.0;

}

zdotc(&c, &n, a, &inca, b, &incb );

printf(

"The complex dot product is: ( %6.2f, %6.2f) ", c.re, c.im );

}

1>Compiling...

1>main.cpp

1>.main.cpp(5) : error C2733: second C linkage of overloaded function 'zdotc' not allowed

1> .main.cpp(4) : see declaration of 'zdotc'

1>Build log was saved at DebugBuildLog.htm"

1>CPokerProject - 1 error(s), 0 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

0 Kudos
1 Reply
rbarron
New Contributor I
1,100 Views

Suggest to use the MKL_Complex16 type defined in MKL header files,
and omit declaration of zdotc() which is already provided by "mkl.h".

So, you had to change the sample code to get it to compile. Welcome to real world.

0 Kudos
Reply