我建立了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'
重建沒有任何問題:
我要去嘗試'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