我正在尝试使用Armadillo C++库开发Linux/Win64应用程序.以下代码在GCC-4.7中编译,但无法使用Armadillo提供的VS项目文件在Visual Studio 2013中编译.
#include <iostream>
#include "armadillo"
using namespace arma;
using namespace std;
//works in GCC-4.7
//VC++2013: compile error: C3066
void foo1(vec::fixed<4> &bar)
{
bar(1) = 1.;
}
//works
void foo2(vec::fixed<4> &bar)
{
bar.at(2) = 1.;
}
//works
void foo3(vec &bar)
{
bar(3) = 1.;
}
int main(int argc, char** argv)
{
cout << "Armadillo version: " << arma_version::as_string() << endl;
vec::fixed<4> bar;
bar.zeros();
foo1(bar);
foo2(bar);
foo3(bar);
cout << "Bar: " << bar << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
错误发生在功能上 …