2017-01-02 38 views
0

我不能使用外部庫在Code :: Blocks上編譯任何代碼。無法編譯使用任何外部庫(Codeblocks)

我嘗試使用升壓拉姆達例如:

#include <boost/lambda/lambda.hpp> 

#include <iostream> 
#include <iterator> 
#include <algorithm> 

int main() 
{ 
    using namespace boost::lambda; 
    typedef std::istream_iterator<int> in; 

    std::for_each(
     in(std::cin), in(), std::cout << (_1 * 3) << " "); 
} 

我有一個全球性的環境變量設置爲庫: https://imgur.com/a/maiRC ...我想我設置構建選項正確。 https://imgur.com/a/BP0Xk

但我的構建不能檢測頭文件:

||=== Build: Debug in boost test (compiler: GNU GCC Compiler) ===| 
C:\Documents and Settings\Charlotte\My Documents\wxTest\boost test\boo.cpp|1|fatal error: boost/lambda/lambda.hpp: No such file or directory| 
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===| 
+0

是在「基地」和「包括」 /「LIB」目錄故意的大/小寫不一致? – pSoLT

+0

感謝您的幫助。不,但我只是解決了這個問題,但沒有奏效。 – VVV

+0

這仍然是一樣的錯誤?嘗試使用「包含」而不是,並將其放在所有std包含之後。 – pSoLT

回答

0

不幸的是,升壓包括在你的第一個圖像路徑被切斷。但它看起來像

C:\Boost\include\boost-1_62\boost 

對不對?

這很可能是不正確的。如果包括拉姆達頭像你這樣(這也是通常的方式包括升壓頭)

#include <boost/lambda/lambda.hpp> 

則必須存在一個名爲

C:\Boost\include\boost-1_62\boost\boost\lambda\lambda.hpp 

這不符合正常的文件增強目錄佈局。那裏有太多的boost。試試你的地球環境的加速路徑設置爲:

C:\Boost\include\boost-1_62 
+0

謝謝,我認爲這是現在的工作 – VVV

+0

@VVV說的方式*感謝*對Stackoverflow是[接受答案](http://stackoverflow.com/help/accepted-answer) 不接受解決的答案你的問題會阻礙讀者回答你未來的問題。 –