与Cygwin的/海湾合作委员会建立Boost库时,名称冲突 [英] Name Conflict when Building Boost libraries with Cygwin/GCC

查看:212
本文介绍了与Cygwin的/海湾合作委员会建立Boost库时,名称冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是从VC ++迁移C ++应用程序到GCC(使用Cygwin在Windows上运行)的过程。现在我的第一个问题是,我不能建立Boost库。

例如与VC建立Boost.Exception ++我会写:

  B2 --with的异常变异=调试,发布链接=静态运行时链接=静态

和我会得到这些文件libboost_exception-VC100-MT-S-1_51.lib和libboost_exception-VC100-MT-SGD-1_51.lib在我的舞台\\ lib目录。

然而,当我使用GCC形成Cygwin的终端,我得到的错误尝试同样的。我发现,只有建设调试(或仅释放)这样的作品:

  ./ B2 --with的异常变异=调试链接=静态运行时链接=静态

这在我的舞台\\这两种情况下(调试和发布)的lib目录下创建libboost_exception.a。因此,似乎有一个名称冲突(同名的调试和发布变种)。这是Boost构建系统中的错误还是我做错了什么?


编辑:

的输出

  ./ B2 --with的异常变异=调试,发布链接=静态运行时链接=静态

是:


  

构建Boost C ++库。


  
  

/cygdrive/c/boost_1_51_0/tool​​s/build/v2/build/virtual-target.jam:1079:从模块虚拟目标虚拟target.register-实际名称


  
  

错误:复制实际目标的名字:libboost_exception.a


  
  

错误:previous虚拟目标{共同%common.copy-libboost_exception.a.STATIC_LIB {GCC%gcc.archive-libboost_exception.a.STATIC_LIB {GCC%gcc.compile.c ++ - clone_current_exception_non_intrusive.o.OBJ { clone_current_exception_non_intrusive.cpp.CPP}}}}


  
  

错误:从./stage-proper创建
  错误:另一个虚拟目标{共同%common.copy-libboost_exception.a.STATIC_LIB {GCC%gcc.archive-libboost_exception.a.STATIC_LIB {GCC%gcc.compile.c ++ - clone_current_exception_non_intrusive.o.OBJ {} clone_current_exception_non_intrusive.cpp.CPP }}}


  
  

错误:从./stage-proper

创建
  
  

错误:添加的属性:关闭NDEBUG全速关闭发布


  
  

错误:删除属性:上调试关关


  
  

/cygdrive/c/boost_1_51_0/tool​​s/build/v2/build/virtual-target.jam:490:从模块对象(文件目标)@ 1014具体化,没有扫描仪


  
  

/cygdrive/c/boost_1_51_0/tool​​s/build/v2/build/virtual-target.jam:135:从模块对象(文件目标)@ 1014 object(file-target)@1014.actualize


  
  

/cygdrive/c/boost_1_51_0/tool​​s/build/v2/build-system.jam:749:从模块构建的系统负载


  
  

/cygdrive/c/boost_1_51_0/tool​​s/build/v2/kernel/modules.jam:283:从模块模块导入


  
  

/cygdrive/c/boost_1_51_0/tool​​s/build/v2/kernel/bootstrap.jam:142:从模块中的升压建立


  
  

/cygdrive/c/boost_1_51_0/boost-build.jam:17:从模块模块范围



解决方案

虽然该错误信息是不完美的,这是操作失误。默认情况下,构建使用库的系统命名 - 命名你有你的典型的Unix系统。所以,是的,如果你试图构建调试和发布变种,你得到的命名冲突。

如果您添加 - 布局=标记 - 布局=版本到命令行,事情应该工作。您可以从顶部目录下运行./b2 --help来获得这些均值一些解释。

I'm in the process of migrating a C++ application from VC++ to GCC (running on Windows using Cygwin). My first problem now is that I cannot build the Boost libraries.

For example to build Boost.Exception with VC++ I would write:

b2 --with-exception variant=debug,release link=static runtime-link=static

and I would get the files libboost_exception-vc100-mt-s-1_51.lib and libboost_exception-vc100-mt-sgd-1_51.lib in my stage\lib directory.

However when I try the same using GCC form a Cygwin terminal I get errors. I found out that building only debug (or only release) like this works:

./b2 --with-exception variant=debug link=static runtime-link=static

It creates libboost_exception.a in my stage\lib directory for both cases (debug and release). So there seems to be a name conflict (same name for debug and release variant). Is this a bug in the boost build system or am I doing something wrong?


Edit:

The output of

./b2 --with-exception variant=debug,release link=static runtime-link=static

is:

Building the Boost C++ Libraries.

/cygdrive/c/boost_1_51_0/tools/build/v2/build/virtual-target.jam:1079: in virtual-target.register-actual-name from module virtual-target

error: Duplicate name of actual target: libboost_exception.a

error: previous virtual target { common%common.copy-libboost_exception.a.STATIC_LIB { gcc%gcc.archive-libboost_exception.a.STATIC_LIB { gcc%gcc.compile.c++-clone_current_exception_non_intrusive.o.OBJ { clone_current_exception_non_intrusive.cpp.CPP } } } }

error: created from ./stage-proper error: another virtual target { common%common.copy-libboost_exception.a.STATIC_LIB { gcc%gcc.archive-libboost_exception.a.STATIC_LIB { gcc%gcc.compile.c++-clone_current_exception_non_intrusive.o.OBJ { clone_current_exception_non_intrusive.cpp.CPP } } } }

error: created from ./stage-proper

error: added properties: off NDEBUG full speed off release

error: removed properties: on off off on debug

/cygdrive/c/boost_1_51_0/tools/build/v2/build/virtual-target.jam:490: in actualize-no-scanner from module object(file-target)@1014

/cygdrive/c/boost_1_51_0/tools/build/v2/build/virtual-target.jam:135: in object(file-target)@1014.actualize from module object(file-target)@1014

/cygdrive/c/boost_1_51_0/tools/build/v2/build-system.jam:749: in load from module build-system

/cygdrive/c/boost_1_51_0/tools/build/v2/kernel/modules.jam:283: in import from module modules

/cygdrive/c/boost_1_51_0/tools/build/v2/kernel/bootstrap.jam:142: in boost-build from module

/cygdrive/c/boost_1_51_0/boost-build.jam:17: in module scope from module

解决方案

Although the error message is not perfect, this is operator error. By default, the build uses system naming of library -- the naming you would have on your typical Unix system. So, yea, if you try to build both debug and release variant, you get naming clash.

If you add --layout=tagged or --layout=versioned to your command line, things should work. You can run "./b2 --help" from the top directory to get some explanation for these mean.

这篇关于与Cygwin的/海湾合作委员会建立Boost库时,名称冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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