作者:朱金灿
来源:http://blog.csdn.net/clever101/
有网友发信给我,说使用DevCpp编译一个MTL库的测试程序出现一堆莫名其妙的错误。
DevCpp我听说过,以前也下载使用过,据说号称Windows平台下的gcc。结果我用DevCpp一编译网友的程序,感觉此编译器不堪大用。
网友的测试程序是这样的:
#include <iostream>#include <boost/numeric/mtl/mtl.hpp>int main(int argc, char* argv[]){ using namespace mtl; // Define dense vector of doubles with 10 elements all set to 0.0. dense_vector<double> v(10, 0.0); // Set element 7 to 3.0. v[7]= 3.0; std::cout << "v is " << v << "/n"; return 0;}
结果出现莫名其妙的错误,说实话它的编译错误提示极为晦涩,我基本看不懂,只好以图为证:
但是我用VS 2008 + sp1编译这个程序,则一点问题都没有。看看网友怎么评论DevCpp的吧:
Get rid of Dev-C++ and download VC++ 2008 Express. If you have any difficulties after that, let us know.
Dev-C++ has not been supported by its creators for a long time. It is horribly out of date. You might be able to just update your version of the compiler and keep the IDE as-is, but you get a really good debugger integrated with VC++ 2008 Express that really blows the competition away.
所以在Windows平台下学习C++,我建议你选择VS 2005及更高版本的VS,或者选择开源的CodeBlocks。
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow