2017-01-02 41 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) 不接受解决的答案你的问题会阻碍读者回答你未来的问题。 –