作者:朱金燦
來源:http://blog.csdn.net/clever101/
有網友發信給我,說使用DevCpp編譯一個MTL庫的測試程式出現一堆莫名其妙的錯誤。
DevCpp我聽說過,以前也下載使用過,據說號稱Windows平台下的gcc。結果我用DevCpp一編譯網友的程式,感覺此編譯器不堪大用。
網友的測試程式是這樣的:
#include <iostream><br />#include <boost/numeric/mtl/mtl.hpp><br />int main(int argc, char* argv[])<br />{<br /> using namespace mtl;<br /> // Define dense vector of doubles with 10 elements all set to 0.0.<br /> dense_vector<double> v(10, 0.0);<br /> // Set element 7 to 3.0.<br /> v[7]= 3.0;<br /> std::cout << "v is " << v << "/n";<br /> return 0;<br />}<br />
結果出現莫名其妙的錯誤,說實話它的編譯錯誤提示極為晦澀,我基本看不懂,只好以圖為證:
但是我用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 2005及更高版本的VS,或者選擇開源的CodeBlocks。