jjzjj

c++ - 使用 Boost.Log 构建 Boost "error: target { simple_event_log.mc. } has no type"

coder 2024-02-24 原文

我正在尝试构建 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 的?

最佳答案

可以找到问题的答案here :

Second, at some point the library will require a Message Compiler tool (mc.exe), which is not available in MinGW, Cygwin and MSVC Express Edition. You have two options to settle the problem. In case of MinGW and Cygwin you can use the windmc.exe tool, which is the analogue of the original mc.exe. In order to do that you will have to patch Boost.Build files (in particular, the tools/build/v2/tools/mc.jam file) as described in this ticket. After that you will be able to specify the mc-compiler=windmc option to bjam to build the library.

这是 patch 的链接.应用补丁并传递 mc-compiler=windmc 应该可以解决问题。

注意:另外,如 ticket 中的评论所述,需要在tools\build\v2\tools\gcc.jamimport fortran ;后添加import mc ;

这是应用补丁后您的 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)。

关于c++ - 使用 Boost.Log 构建 Boost "error: target { simple_event_log.mc. } has no type",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12242733/

有关c++ - 使用 Boost.Log 构建 Boost "error: target { simple_event_log.mc. } has no type"的更多相关文章

  1. ruby-on-rails - rails : "missing partial" when calling 'render' in RSpec test - 2

    我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou

  2. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  3. ruby-on-rails - Ruby on Rails : . 常量化 : wrong constant name error? - 2

    我正在使用这个:4.times{|i|assert_not_equal("content#{i+2}".constantize,object.first_content)}我之前声明过局部变量content1content2content3content4content5我得到的错误NameError:wrongconstantnamecontent2这个错误是什么意思?我很确定我想要content2=\ 最佳答案 你必须用一个大字母来调用ruby​​常量:Content2而不是content2。Aconstantnamestart

  4. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  5. ruby-on-rails - 如何优雅地重启 thin + nginx? - 2

    我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server

  6. ruby-on-rails - 迷你测试错误 : "NameError: uninitialized constant" - 2

    我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test

  7. ruby-on-rails - 相关表上的范围为 "WHERE ... LIKE" - 2

    我正在尝试从Postgresql表(table1)中获取数据,该表由另一个相关表(property)的字段(table2)过滤。在纯SQL中,我会这样编写查询:SELECT*FROMtable1JOINtable2USING(table2_id)WHEREtable2.propertyLIKE'query%'这工作正常:scope:my_scope,->(query){includes(:table2).where("table2.property":query)}但我真正需要的是使用LIKE运算符进行过滤,而不是严格相等。然而,这是行不通的:scope:my_scope,->(que

  8. 使用 ACL 调用 upload_file 时出现 Ruby S3 "Access Denied"错误 - 2

    我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file

  9. ruby-on-rails - 错误 : Error installing pg: ERROR: Failed to build gem native extension - 2

    我克隆了一个rails仓库,我现在正尝试捆绑安装背景:OSXElCapitanruby2.2.3p173(2015-08-18修订版51636)[x86_64-darwin15]rails-v在您的Gemfile中列出的或native可用的任何gem源中找不到gem'pg(>=0)ruby​​'。运行bundleinstall以安装缺少的gem。bundleinstallFetchinggemmetadatafromhttps://rubygems.org/............Fetchingversionmetadatafromhttps://rubygems.org/...Fe

  10. ruby - 安装 Ruby 时遇到问题(无法下载资源 "readline--patch") - 2

    当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub

随机推荐