使用b2工具进行编译时找不到Boost标头 [英] Can't find Boost headers when compiling with b2 tool

查看:440
本文介绍了使用b2工具进行编译时找不到Boost标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在尝试使用b2工具编译我的程序,我将Jamroot文件定义如下,以协助编译。当我执行命令'b2 toolset = gcc'时,我得到多个错误,指出b2找不到像asio.hpp和bind.hpp这样的Boost头文件:



那么我在Jamroot中缺少什么?



Hello,

I am trying to compile my program using b2 tool, I defined a Jamroot file as following to assist in the compilation. When I execute the command 'b2 toolset=gcc', I get multiple error stating that b2 can't find Boost header files like asio.hpp and bind.hpp:

So what am I missing in the Jamroot?

import os ;
import errors ;
import option ;
import path ;

project test
: requirements
    <link>static
    <toolset>gcc:<cxxflags>-std=c++0x
;

path-constant test-root : . ;

#
# Import the boost project
#
local boost-major = 1 ;
local boost-minor = 49 ;
local boost-patch = 0 ;
local boost-root ;

boost-root ?= [ option.get boost-root ] ;
boost-root ?= [ os.environ BOOST_ROOT ] ;

if ! $(boost-root) {
boost-root = [ path.join $(test-root) ../boost_$(boost-major)_$(boost-minor)_$(boost-patch) ] ;
}
use-project boost : $(boost-root) ;

#
# Build
#
exe test :
main.cpp
messagecpp
tcp_listener.cpp
tcp_sender.cpp
;

install install
: test
;

推荐答案

(boost-root){
boost-root = [ path join
(boost-root) { boost-root = [ path.join


(test-root)../ boost _
(test-root) ../boost_


(boost-major)_
(boost-major)_


这篇关于使用b2工具进行编译时找不到Boost标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆