使用minGW构建Boost

时间:2013-12-30 17:54:55

标签: c++ gcc boost mingw codeblocks

我使用CodeBlocks(minGW),我遇到构建boost的问题。 “C:\ Program Files(x86)\ CodeBlocks \ MinGW \ bin”在Path变量中,我能够使用“bootstrap.bat gcc”构建b2和bjam但是在“b2 toolset = gcc --build-type =之后”完成“我得到一些错误。

输出:

link.jam: No such file or directory

Building the Boost C++ Libraries.


Performing configuration checks

    - 32-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes
    - has_icu builds           : no
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
    - zlib                     : no
    - iconv (libc)             : no
    - iconv (separate)         : no
    - icu                      : no
    - icu (lib64)              : no
    - g++ -shared-* supported  : yes
    - message-compiler         : no
    - compiler-supports-ssse3  : yes
    - compiler-supports-avx2   : yes
    - gcc visibility           : yes
    - long double support      : yes
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
warning: No python installation configured and autoconfiguration
note: failed.  See http://www.boost.org/libs/python/doc/building.html
note: for configuration instructions or pass --without-python to
note: suppress this message and silently skip all Boost.Python targets
    - zlib                     : no  (cached)
    - zlib                     : no  (cached)
    - zlib                     : no  (cached)
    - zlib                     : no
    - zlib                     : no  (cached)
    - zlib                     : no  (cached)
    - zlib                     : no  (cached)
    - zlib                     : no  (cached)
    - zlib                     : no  (cached)
    - zlib                     : no  (cached)
    - zlib                     : no  (cached)
C:/libs/boost_1_55_0/tools/build/v2/build\virtual-target.jam:1099: in virtual-target.register-actual-name from module virtual-target
error: Duplicate name of actual target: libboost_exception-mgw47-mt-1_55.a
error: previous virtual target { common%common.copy-libboost_exception-mgw47-mt-1_55.a.STATIC_LIB { gcc%gcc.archive-libboost_exception-mgw47-mt-1_55.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-mgw47-mt-1_55.a.STATIC_LIB { gcc%gcc.archive-libboost_exception-mgw47-mt-1_55.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: -shared-libgcc -shared-libstdc++
error: removed properties: none
C:/libs/boost_1_55_0/tools/build/v2/build\virtual-target.jam:484: in actualize-no-scanner from module object(file-target)@5267
C:/libs/boost_1_55_0/tools/build/v2/build\virtual-target.jam:134: in class@virtual-target.actualize from module object(file-target)@5267
C:/libs/boost_1_55_0/tools/build/v2\build-system.jam:720: in load from module build-system
C:\libs\boost_1_55_0\tools\build\v2/kernel\modules.jam:289: in import from module modules
C:\libs\boost_1_55_0\tools\build\v2/kernel/bootstrap.jam:139: in boost-build from module
C:\libs\boost_1_55_0\boost-build.jam:17: in module scope from module

1 个答案:

答案 0 :(得分:4)

(OP在问题编辑中回答。转换为社区维基答案。请参阅Question with no answers, but issue solved in the comments (or extended in chat)

OP写道:

  

我试过b2 toolset=gcc并且它有效。   当我尝试使用boost :: threads并通过链接解决它时,我得到了错误“对boost :: system :: ..的未定义引用”:

boost_thread-mgw47-mt-1_55
boost_system-mgw47-mt-1_55