[原创&交流]如果你学习C++,请不要选择DevCpp

clever101 clever101 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
链接:如果你学习C++,请不要选择DevCpp


有网友发信给我,说使用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.

评论来自:
http://bbs.prog365.com/c-programming-on-using-mtl-matrix-template-library-in-dev-c-4.9.8.0-190-1-1.html

所以在Windows平台下学习C++,我建议你选择VS 2008及更高版本的VS,或者选择开源的CodeBlocks。




...全文
评论 30
收藏 已收藏
分享
返回顶部
clever101
clever101 领域专家: C/C++技术领域 领域专家: C/C++技术领域
C++ 语言 65,212 成员 250,513 内容