[英]Cannot compile using any external libraries (Codeblocks)
我無法使用Code :: Blocks上的外部庫來編譯任何代碼。
我嘗試使用boost lambda示例:
#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)) ===|
不幸的是,第一個圖像中的增強包含路徑被切斷了。 但是看起來
C:\Boost\include\boost-1_62\boost
對?
這很可能是不正確的。 如果像您一樣包含lambda標頭(這也是添加boost標頭的常用方法)
#include <boost/lambda/lambda.hpp>
然后需要存在一個名為
C:\Boost\include\boost-1_62\boost\boost\lambda\lambda.hpp
這不適合正常的Boost目錄布局。 那里有太多的boost
。 嘗試將您的全局環境設置為Boost路徑:
C:\Boost\include\boost-1_62
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.