次のリンクに基づいて、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' は 'std' のメンバーではありません
問題なく再構築します: