I know that similar questions are coming nearly everyday but unfortunately no thread deals exactly with the solution to a (in my opinion) common problem:
As the Subject tell you, I want to build the lapack and blas libs to use with vc++ 2005.
Currently I downloaded the clapack-windows 3 package and already compiled it with the included project files for vc++2005.
I was also able to compile and execute all the sample files.
Now when I try to build an own sample like the following:
- Code: Select all
#include <stdio.h>
#include "M:\C-Development\lapack_tests\CLAPACK-windows\BLAS\WRAP\blaswrap.h"
#include "M:\C-Development\lapack_tests\CLAPACK-windows\BLAS\WRAP\f2c.h"
#include "M:\C-Development\lapack_tests\CLAPACK-windows\BLAS\WRAP\cblas.h"
int main(int argc, char* argv[])
{
double m[] = {
3, 1, 3,
1, 5, 9,
2, 6, 5
};
double x[] = {
-1, -1, 1
};
double y[] = {
0, 0, 0
};
int i, j;
for (i=0; i<3; ++i) {
for (j=0; j<3; ++j) printf("%5.1f", m[i*3+j]);
putchar('\n');
}
cblas_dgemv(CblasRowMajor, CblasNoTrans, 3, 3, 1.0, m, 3,
x, 1, 0.0, y, 1);
for (i=0; i<3; ++i)
printf("%5.1f\n", y[i]);
return 0;
}
I get the following linker error:
error LNK2019: unresolved external symbol "void __cdecl cblas_dgemv(enum CBLAS_ORDER,enum CBLAS_TRANSPOSE,int,int,double,double const *,int,double const *,int,double,double *,int)" (?cblas_dgemv@@YAXW4CBLAS_ORDER@@W4CBLAS_TRANSPOSE@@HHNPBNH2HNPANH@Z) referenced in function _main
As it is a debug project at the moment, I told the linker to use the debug libraries in the following order:
\Debug\tmglib.lib
\Debug\clapack.lib
\Debug\blas.lib
\Debug\libF77.lib
\Debug\libI77.lib
kernel32.lib
I have also tried to set my project as a C-Only projekt and not a c++ project, but this did not solve the problem.
Could you help me out or point me in the right direction on how I can use the lapack/blas or clapack/blas library with vc++ 2005.
If there is an easy way to compile the fortran lapack version and then use it with vc++ I can also try this as I have access to the intel fortran 9.1 compiler for windows.
Thank you a lot in advance.
With best regards.
dvdjimmy

