- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just loaded the Intel MKL library andI am trying to make an example work in C++. I copied the example from the web. The code I copied is as below:
//Example 2: Calling a Complex BLAS Level 1 Function from C++
#include "mkl.h"
typedef struct{ double re; double im; } complex16;
extern "C" void zdotc (complex16*, int *, complex16 *, int *, complex16 *, int *);
#define N 5
void test1()
{
int n, inca = 1, incb = 1, i;
complex16 a
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 );
}
I get as an error : second C linkage of overloaded function 'zdotc' not allowed
Can somebody tell me/help me about why the above is not working?
Thank you for your help.
E.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
void zdotc(MKL_Complex16 *pres, const MKL_INT *n, const MKL_Complex16 *x, const MKL_INT *incx, const MKL_Complex16 *y, const MKL_INT *incy);
Todd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Todd,
Thank u for ur response.
I could not get the above code to work, by the way its in Visual Studio 2008, I then decided to change a bit and try the below one:
#include "mkl.h"
extern "C" float sdot(const MKL_INT *n, const float *x, const MKL_INT *incx, const float *y, const MKL_INT *incy);
#define N 5
void test1()
{
MKL_INT n, inca = 1, incb = 1, i;
const float a
n = N;
sdot(&n, a, &inca, b, &incb);
printf( "The dot product is: ( %6.2f, %6.2f) ", n );
}
The error msg I get is:
mkl_intel_c.lib(_sdot.obj) : error LNK2019: unresolved external symbol _mkl_blas_sdot referenced in function _sdot
1>Release/XLStats.xll : fatal error LNK1120: 1 unresolved externals
Does anyboduy have an idea about how to fix it?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page