I built DLLs & Libs of LAPACKE for my Visual Studio 2008 based on the following link:
http://icl.cs.utk.edu/lapack-for-windows/lapack/
After building LAPACKE, I tested as below and it passed the tests:
After building, I have the following files available:
I used the following tips in my Visual Studio 2008:
Now I have the following Visual Studio 2008 project:
I have the following pieces of C++ code in my project:
When I comment out the line #include "lapacke.h"
the executable builds and I get the following console output:
However, when I don't comment out #include "lapacke.h"
I get the following errors:
Error location is line 73 of lapacke.h
shown below:
I appreciate any help.
EDIT:
Even after including #include <cstdlib>
before #include "lapacke.h"
, the same errors happen:
EDIT:
On the following links some people have discussed an issue which looks relevant:
http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=2284
http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=4221
EDIT
in the file lapacke.h
the following statements are available for complex types.
/* Complex types are structures equivalent to the
* Fortran complex types COMPLEX(4) and COMPLEX(8).
*
* One can also redefine the types with his own types
* for example by including in the code definitions like
*
* #define lapack_complex_float std::complex<float>
* #define lapack_complex_double std::complex<double>
*
* or define these types in the command line:
*
* -Dlapack_complex_float="std::complex<float>"
* -Dlapack_complex_double="std::complex<double>"
*/
#ifndef LAPACK_COMPLEX_CUSTOM
/* Complex type (single precision) */
#ifndef lapack_complex_float
#include <complex.h>
#define lapack_complex_float float _Complex
#endif
#ifndef lapack_complex_float_real
#define lapack_complex_float_real(z) (creal(z))
#endif
#ifndef lapack_complex_float_imag
#define lapack_complex_float_imag(z) (cimag(z))
#endif
lapack_complex_float lapack_make_complex_float( float re, float im );
/* Complex type (double precision) */
#ifndef lapack_complex_double
#include <complex.h>
#define lapack_complex_double double _Complex
#endif
#ifndef lapack_complex_double_real
#define lapack_complex_double_real(z) (creal(z))
#endif
#ifndef lapack_complex_double_imag
#define lapack_complex_double_imag(z) (cimag(z))
#endif
lapack_complex_double lapack_make_complex_double( double re, double im );
#endif
I modified the header file as below:
However I receive the following error:
The above error happens at the following location:
I'm not sure how to resolve this error.
EDIT:
Finally solved the problem by adding #include <complex>
as shown below. By the way, this post helped me to figure it out: MinGW error: 'min' is not a member of 'std'
Rebuilds without any problem:
Lapacke
is C code, not C++. Visual C++ has only limited support for C, and does not support_Complex
. In C++, you'd usestd::complex<float>
.Defining
LAPACK_COMPLEX_CUSTOM
may skip the use of_Complex
, according to the code you've shown.PS. please include source code in your question, not images.