2011-10-29 73 views
0

我剛剛下載了boost 1.4.7.0,但編譯器無法找到boost/lexcal_cast.hpp<boost/lexcal_cast.hpp>在哪裏?

我想將字符串轉換爲使用boost的數字。 示例代碼:

#include <boost/lexcal_cast.hpp> 

// ... 
int i = 42; 
std::string s = boost::lexical_cast<std::string>(i); 
int j = boost::lexical_cast<int>(s) 

我在哪裏可以找到?除了標準之外還需要額外的圖書館嗎?

謝謝。

+1

你從哪裏得到提升? – GWW

+0

C:\ boost_1_47_0。在這個目錄下,我有\ boost \,\ docs \,\ libs \,\ more \,\ status \和\ tools \。基本上,提取後的默認設置。謝謝GWW – CppLearner

+0

@GWW nvm。馬塞洛發現了我愚蠢的錯誤。謝謝你幫助我! – CppLearner

回答

5

你試過<boost/lexical_cast.hpp>?你錯過了‘我’。

+0

謝謝!該死的。我從一個線索複製了這個,我一直在尋找兩天。多麼愚蠢的錯誤......謝謝..哈哈 – CppLearner