我正在尝试编译一些较旧的代码,但我不断收到:
../include/timeobject.h: In member function ‘void timeobject::initialize()’:
../include/timeobject.h:24:17: error: lvalue required as left operand of assignment
real(f[i]) = 0.;
^~
../include/timeobject.h:25:17: error: lvalue required as left operand of assignment
imag(f[i]) = 0.;
^~
../include/timeobject.h: In member function ‘void timeobject::integrateRK4()’:
../include/timeobject.h:57:32: error: lvalue required as left operand of assignment
real(v[ktime])=real(f[ktime]);
此代码用于编译没有问题。所有的编译错误都是这样的,并且都只出现在对复变量的实部/虚部进行赋值的行上。
我忘记了什么? (该程序正在使用 openmpi 版本编译:
mpicxx --version
g++ (Debian 8.3.0-6) 8.3.0