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:

enter image description here

After building, I have the following files available:

enter image description here enter image description here enter image description here enter image description here

I used the following tips in my Visual Studio 2008:

enter image description here

Now I have the following Visual Studio 2008 project:

enter image description here

I have the following pieces of C++ code in my project:

enter image description here enter image description here enter image description here

When I comment out the line #include "lapacke.h" the executable builds and I get the following console output:

enter image description here

However, when I don't comment out #include "lapacke.h"I get the following errors:

enter image description here

Error location is line 73 of lapacke.h shown below:

enter image description here

I appreciate any help.


EDIT:

Even after including #include <cstdlib> before #include "lapacke.h", the same errors happen:

enter image description here


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:

enter image description here

However I receive the following error:

enter image description here

The above error happens at the following location:

enter image description here

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'

enter image description here

Rebuilds without any problem:

enter image description here

1

There are 1 answers

3
MSalters On BEST ANSWER

Lapacke is C code, not C++. Visual C++ has only limited support for C, and does not support _Complex. In C++, you'd use std::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.