首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >致命错误C1083:无法打开包含文件:‘comp.h’:没有这样的文件或目录..\lapacke\include\lapacke.h

致命错误C1083:无法打开包含文件:‘comp.h’:没有这样的文件或目录..\lapacke\include\lapacke.h
EN

Stack Overflow用户
提问于 2014-11-14 15:40:07
回答 1查看 4.6K关注 0票数 2

我根据以下链接为我的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中,以下语句可用于复杂类型。

代码语言:javascript
复制
/* 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'

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-11-14 16:32:05

Lapacke是C代码,而不是C++。Visual C++对C的支持有限,不支持_Complex。在C++中,您可以使用std::complex<float>

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

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26933589

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档