我基于以下链接为我的 Visual Studio 2008 构建了 LAPACKE 的 DLL 和库:
http://icl.cs.utk.edu/lapack-for-windows/lapack/
在构建 LAPACKE 之后,我进行了如下测试,它通过了测试:
构建后,我有以下文件可用:
我在 Visual Studio 2008 中使用了以下技巧:
现在我有以下 Visual Studio 2008 项目:
我的项目中有以下 C++ 代码:
当我注释掉#include "lapacke.h"
可执行文件构建的行时,我得到以下控制台输出:
但是,当我不注释掉时,#include "lapacke.h"
会出现以下错误:
错误位置是下lapacke.h
图的第 73 行:
我很感激任何帮助。
编辑:
即使在包含#include <cstdlib>
before 之后#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 错误:'min' is not a member of 'std'
重建没有任何问题: