4

我正在尝试构建 Boost.Log ( http://boost-log.sourceforge.net/libs/log/doc/html/index.html )。我将它添加到我的 boost 源中并执行了我通常的 boost 构建命令。

b2 --build-dir="D:\boost\1.51.0\boost" toolset=gcc variant=release link=static threading=multi  runtime-link=static --build-type=complete

但什么也没发生,我最终收到了这个:

D:/boost/1.51.0/src/tools/build/v2/build\generators.jam:1085: in ensure-type from module generators
error: target { simple_event_log.mc. } has no type
D:/boost/1.51.0/src/tools/build/v2/build\generators.jam:1319: in generators.construct from module generators
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:1495: in construct from module object(typed-target)@491
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:1298: in object(typed-target)@491.generate from module object(typed-target)@491
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:732: in generate-really from module object(main-target)@1871

D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:704: in object(main-target)@1871.generate from module object(main-target)@1871
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:258: in object(project-target)@474.generate from module object(project-target)@474
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:848: in targets.generate-from-reference from module targets D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:1217: in generate-dependencies from module object(install-target-class)@96
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:1269: in object(install-target-class)@96.generate from module object(install-target-class)@96
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:732: in generate-really from module object(main-target)@930 D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:704: in object(main-target)@930.generate from module object(main-target)@930
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:848: in targets.generate-from-reference from module targets D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:1217: in generate-dependencies from module object(top-level-target)@103
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:1269: in alias-target-class.generate from module object(top-level-target)@103
D:/boost/1.51.0/src\boostcpp.jam:391: in build-multiple from module object(top-level-target)@103
D:/boost/1.51.0/src\boostcpp.jam:376: in object(top-level-target)@103.generate from module object(top-level-target)@103
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:732: in generate-really from module object(main-target)@934 D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:704: in object(main-target)@934.generate from module object(main-target)@934
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:848: in targets.generate-from-reference from module targets D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:1217: in generate-dependencies from module object(top-level-target)@104
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:1269: in alias-target-class.generate from module object(top-level-target)@104
D:/boost/1.51.0/src\boostcpp.jam:391: in build-multiple from module object(top-level-target)@104
D:/boost/1.51.0/src\boostcpp.jam:376: in object(top-level-target)@104.generate from module object(top-level-target)@104
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:732: in generate-really from module object(main-target)@935 D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:704: in object(main-target)@935.generate from module object(main-target)@935
D:/boost/1.51.0/src/tools/build/v2/build\targets.jam:258: in object(project-target)@42.generate from module object(project-target)@42
D:/boost/1.51.0/src/tools/build/v2\build-system.jam:736: in load from module build-system
D:\boost\1.51.0\src\tools\build\v2/kernel\modules.jam:283: in import from module modules
D:\boost\1.51.0\src\tools\build\v2/kernel/bootstrap.jam:142: in boost-build from module
D:\boost\1.51.0\src\boost-build.jam:17: in module scope from module                                   

你能解释一下这是什么意思或我如何能看到更多的错误信息吗?你是如何构建 Boost.Log 的?

4

2 回答 2

2

问题的答案可以在这里找到:

其次,在某些时候,该库将需要一个消息编译器工具 (mc.exe),而 MinGW、Cygwin 和 MSVC Express Edition 中不提供该工具。您有两种选择来解决问题。在 MinGW 和 Cygwin 的情况下,您可以使用 windmc.exe 工具,它是原始 mc.exe 的类似物。为此,您必须按照此票证中的说明修补 Boost.Build 文件(特别是 tools/build/v2/tools/mc.jam 文件)。之后,您将能够为 bjam 指定 mc-compiler=windmc 选项来构建库。

这是补丁的链接。应用补丁并通过mc-compiler=windmc应该可以解决问题。

注意:另外,如票据中的评论所述,您需要在inimport mc ;之后添加。import fortran ;tools\build\v2\tools\gcc.jam

这是您的 mc.jam 文件在应用补丁后的样子(确保您的文件如下所示):

import common ;
import generators ;
import feature : feature get-values ;
import toolset : flags ;
import type ;
import rc ;

feature.feature mc-compiler : mc windmc : propagated ; 
feature.set-default mc-compiler : mc ; 

rule init ( )
{
}

type.register MC : mc ;


# Command line options
feature mc-input-encoding : ansi unicode : free ;
feature mc-output-encoding : unicode ansi : free ;
feature mc-set-customer-bit : no yes : free ;

flags mc.compile MCFLAGS <mc-input-encoding>ansi : -a ;
flags mc.compile MCFLAGS <mc-input-encoding>unicode : -u ;
flags mc.compile MCFLAGS <mc-output-encoding>ansi : -A ;
flags mc.compile MCFLAGS <mc-output-encoding>unicode : -U ;
flags mc.compile MCFLAGS <mc-set-customer-bit>no : ;
flags mc.compile MCFLAGS <mc-set-customer-bit>yes : -c ;

generators.register-standard mc.compile.mc : MC : H RC : <mc-compiler>mc ; 
generators.register-standard mc.compile.windmc : MC : H RC : <mc-compiler>windmc ;

actions compile.mc
{ 
    mc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)" 
}

actions compile.windmc
{ 
    windmc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)" 
} 

警告

boost-log\branches\bleeding-edge无法为我编译(gcc 4.7.1)。我使用其中boost-log\trunk\boost-log一个成功构建(构建于 2012-09-05)。

于 2012-09-19T00:27:55.670 回答
0

尝试:

b2 toolset=gcc --build-type=complete threading=multi architecture=x86 address-model=32 --with-log define=BOOST_LOG_USE_CHAR --stagedir=.

Boost 1.51 和 Boost::Log rev 对我有用。721

于 2012-09-05T13:56:14.540 回答