0
我想配置drone.io來自動測試我的C++項目。不幸的是每次構建失敗,因爲SCons找不到我剛安裝的頭文件。我開始與此:帶有Boost庫的C++ Drone.io配置
sudo apt-get install g++ bison flex libgmp-dev glpk libboost-all-dev scons
echo 2 | sudo update-alternatives --config gcc
scons -Q runProgramsTests
但每次build failed一個消息:
$ scons -Q runProgramsTests
Your environment does not seem to have header <boost/container/map.hpp>!!
Your environment does not seem to have header <boost/container/set.hpp>!!
Your environment does not seem to have header <boost/container/vector.hpp>!!
Invalid compiler/libraries installation - build terminated!!
負責此消息構建腳本的部分看起來像這樣:
# Assuming that instalation is valid unless proved otherwise
validInstallation = True
conf = Configure(env)
# C++ check
if not conf.CheckCXX():
print('Your environment/C++ compiler is not configured/installed correctly!!')
validInstallation = False
# Header check
for header in [
# standard libraries
'algorithm', 'cstdlib', 'iomanip',
'iostream', 'fstream', 'sstream',
'memory',
'stdexcept', 'string', 'utility',
# boost libraries
'boost/scoped_ptr.hpp',
'boost/shared_ptr.hpp',
'boost/weak_ptr.hpp',
'boost/algorithm/string.hpp',
'boost/assign.hpp',
'boost/bimap/bimap.hpp',
'boost/container/map.hpp',
'boost/container/set.hpp',
'boost/container/vector.hpp',
'boost/program_options.hpp',
'boost/range/adaptor/map.hpp',
'boost/range/adaptor/reversed.hpp',
# Flex library
'FlexLexer.h',
# GNU Multiple Precision library
'gmpxx.h',
# GNU Linear Package Kit
'glpk.h'
]:
if not conf.CheckCXXHeader(header):
print('Your environment does not seem to have header <'+header+'>!!')
validInstallation = False
如果關鍵整個SConstruct
的內容可以找到here。
我不明白爲什麼會找到一些Boost包,有些則不是。在droid.io頁面上,我發現由項目生成的歸檔工件的信息不能超過10MB - 但是沒有關於已安裝庫限制的信息。
調用scons
沒有幫助之前運行sudo ldconfig
,所以沒有手動設置幫助環境變量:
C_INCLUDE_PATH=/usr/include
CPLUS_INCLUDE_PATH=/usr/include
難道我錯過了什麼?畢竟我安裝了libboost-all-dev
,它應該包含所有的Boost庫和頭文件。