我在 Windows 中使用 TDM gcc 64 位编译器
我的标题
#include "lapacke.h"
#include "lapacke_config.h"
我有一个像这样的简单代码
lapack_complex_double x = {8.0, 6.0};
printf( "x = (%6.2f,%6.2f)\n", x.real, x.imag);
首先,它给了我以下错误和警告
warning: excess elements in scalar initializer
lapack_complex_double x = {8.0, 6.0};
&
error: request for member 'real' in something, not a structure or union
printf( "x = (%6.2f,%6.2f)\n", x.real, x.imag);
我将代码更改如下
lapack_complex_double x = {8.0, 6.0};
printf( "x = (%6.2f,%6.2f)\n", lapack_complex_double_real(x),
lapack_complex_double_imag(x) );
代码是用同样提到的警告编译的,但结果是
x = ( 8.00, 0.00)
看来警告是一个重要的错误。