我根据以下链接为我的Visual 2008构建了LAPACKE的DLL和Libs:
http://icl.cs.utk.edu/lapack-for-windows/lapack/
在构建了LAPACKE之后,我进行了如下测试,并通过了测试:

在构建之后,我有以下可用的文件:




我在Visual 2008中使用了以下技巧:

现在我有了以下Visual 2008项目:

我的项目中有以下几段C++代码:



当我注释掉行#include "lapacke.h"时,可执行文件生成并得到以下控制台输出:

但是,当我不注释掉#include "lapacke.h"时,我会得到以下错误:

错误位置是lapacke.h的第73行,如下所示:

我很感谢你的帮助。
编辑:
即使在将#include <cstdlib>包含在#include "lapacke.h"之前,也会发生相同的错误:

编辑:
在以下链接上,一些人讨论了一个看似相关的问题:
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
编辑
在文件lapacke.h中,以下语句可用于复杂类型。
/* 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我修改了头文件如下:

但是,我收到以下错误:

上述错误发生在以下位置:

我不知道如何解决这个错误。
编辑:
最后通过添加#include <complex>解决了这个问题,如下所示。顺便说一句,这篇文章帮助我找到了答案:MinGW error: 'min' is not a member of 'std'

重新构建,没有任何问题:

发布于 2014-11-14 16:32:05
Lapacke是C代码,而不是C++。Visual C++对C的支持有限,不支持_Complex。在C++中,您可以使用std::complex<float>。
根据您展示的代码,定义LAPACK_COMPLEX_CUSTOM可能会跳过_Complex的使用。
PS。请在你的问题中包括源代码,而不是图片。
https://stackoverflow.com/questions/26933589
复制相似问题