致命错误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后,我测试如下,它通过测试:

enter image description here

建设后,我已经准备好以下文件:

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

我用下面的提示在我的Visual Studio 2008:

enter image description here

现在我有下面的Visual Studio 2008项目:

enter image description here

,我有以下的C++代码段在我的项目:

enter image description hereenter image description hereenter image description here

当我注释掉#include "lapacke.h"可执行构建和我得到以下控制台输出:

enter image description here

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

enter image description here

错误位置线如下图所示的lapacke.h 73:

enter image description here

我感谢所有帮助。


编辑:

即使包括#include <cstdlib>#include "lapacke.h"之前之后,同样的错误发生:

enter image description here


编辑:

以下链接一些人讨论它看起来相关的一个问题:文件中

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 

我修改为下面的头文件:

enter image description here

但是我收到以下错误:

enter image description here

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

enter image description here

我不知道如何解决此错误。


编辑:

通过如下所示加入#include <complex>最后解决了这个问题。顺便说一句,这篇文章帮我弄明白:MinGW error: 'min' is not a member of 'std'

enter image description here

重建没有任何问题:

enter image description here

Lapacke是C代码,而不是C++。 Visual C++仅支持C,并且不支持_Complex。在C++中,你会使用std::complex<float>

根据您显示的代码,定义LAPACK_COMPLEX_CUSTOM可能会跳过使用_Complex

PS。请在您的问题中包含源代码,而不是图片。

+0

我要去尝试'std :: complex ' – user3405291 2014-11-14 16:34:03

+0

我试过'std :: complex ',我用结果更新了问题。我不知道如何解决它。 – user3405291 2014-11-14 18:17:14

+0

解决了问题并使用解决方案更新了问题。 – user3405291 2014-11-14 18:54:22