致命错误C1083:无法打开包含文件:'complex.h':没有这样的文件或目录.. \ lapacke \ include \ lapacke.h
我建立了DLL &我的Visual Studio 2008基于以下链接的LAPACKE :致命错误C1083:无法打开包含文件:'complex.h':没有这样的文件或目录.. lapacke include lapacke.h
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>
#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'
重建没有任何问题:
Lapacke
是C代码,而不是C++。 Visual C++仅支持C,并且不支持_Complex
。在C++中,你会使用std::complex<float>
。
根据您显示的代码,定义LAPACK_COMPLEX_CUSTOM
可能会跳过使用_Complex
。
PS。请在您的问题中包含源代码,而不是图片。
我要去尝试'std :: complex' –
user3405291
2014-11-14 16:34:03
我试过'std :: complex',我用结果更新了问题。我不知道如何解决它。 –
user3405291
2014-11-14 18:17:14
解决了问题并使用解决方案更新了问题。 – user3405291 2014-11-14 18:54:22