【问题标题】:Fail to build Boost system libraryBoost系统库构建失败
【发布时间】:2015-02-25 13:39:41
【问题描述】:

我正在尝试使用命令从 Boost 构建“系统”库:

bjam --toolset=gcc 目标操作系统=qnx --build-dir=c:\boost_1_57_0 --build-type=complete --with-system 阶段

并不断出错:

C:\boost_1_57_0>bjam --toolset=gcc target-os=qnx --build-dir=c:\boost_1_57_0 --build-type=complete --with-system 阶段 ...找到 1 个目标... ...更新 1 个目标... config-cache.write c:\boost_1_57_0\boost\bin.v2\project-cache.jam ...更新了 1 个目标...

组件配置:

- atomic                   : not building
- chrono                   : not building
- container                : not building
- context                  : not building
- coroutine                : not building
- date_time                : not building
- exception                : not building
- filesystem               : not building
- graph                    : not building
- graph_parallel           : not building
- iostreams                : not building
- locale                   : not building
- log                      : not building
- math                     : not building
- mpi                      : not building
- program_options          : not building
- python                   : not building
- random                   : not building
- regex                    : not building
- serialization            : not building
- signals                  : not building
- system                   : building
- test                     : not building
- thread                   : not building
- timer                    : not building
- wave                     : not building

...找到 205 个目标... ...更新 4 个目标... gcc.link.dll c:\boost_1_57_0\boost\bin.v2\libs\system\build\gcc-mingw-4.8.1\debug\target-os-qnx\threading-multi\libboost_system-mgw48-mt-d-1_57.so.1.57 .0 c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: 找不到 -lrt collect2.exe:错误:ld 返回 1 个退出状态

"g++"    -o "c:\boost_1_57_0\boost\bin.v2\libs\system\build\gcc-mingw-4.8.1\debug\target-os-qnx\threading-multi\libboost_system-mgw48-mt-d-1_57.so.1.57.0"

-shared -Wl,--start-group "c:\boost_1_57 _0\boost\bin.v2\libs\system\build\gcc-mingw-4.8.1\debug\target-os-qnx\threading-multi\error_code.o" -Wl,-Bstatic -Wl,-Bdynamic -lrt -Wl,--end-group -g -pthread

...gcc.link.dll 失败 c:\boost_1_57_0\boost\bin.v2\libs\system\build\gcc-mingw-4.8.1\debug\target-os-qnx\threading-multi\libboost_system-mgw48-mt-d-1_57.so.1.57 .0... ...跳过 libboost_system-mgw48-mt-d-1_57.so.1.57.0 缺乏 libboost_system-mgw48- mt-d-1_57.so.1.57.0... gcc.link.dll c:\boost_1_57_0\boost\bin.v2\libs\system\build\gcc-mingw-4.8.1\release\target-os-qnx\threading-multi\libboost_system-mgw48-mt-1_57.so.1.57.0 c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: 找不到 -lrt collect2.exe:错误:ld 返回 1 个退出状态

"g++"    -o "c:\boost_1_57_0\boost\bin.v2\libs\system\build\gcc-mingw-4.8.1\release\target-os-qnx\threading-multi\libboost_system-mgw48-mt-1_57.so.1.57.0"

-shared -Wl,--start-group "c:\boost_1_57 _0\boost\bin.v2\libs\system\build\gcc-mingw-4.8.1\release\target-os-qnx\threading-multi\error_code.o" -Wl,-Bstatic -Wl,-Bdynamic -lrt -Wl,--end-group -pthread

...gcc.link.dll 失败 c:\boost_1_57_0\boost\bin.v2\libs\system\build\gcc-mingw-4.8.1\release\target-os-qnx\threading-multi\libboost_system-mgw48-mt-1_57.so.1.57.0 ... ...跳过 libboost_system-mgw48-mt-1_57.so.1.57.0 缺乏 libboost_system-mgw48- mt-1_57.so.1.57.0... ...更新 2 个目标失败... ...跳过 2 个 目标...

rt lib好像不见了,哪里可以得到这样的lib来成功编译'system'lib?

【问题讨论】:

    标签: c++ gcc boost mingw qnx


    【解决方案1】:

    我的问题的解决方案:

    • 首先要做的是获取 MinGW 并将其放在 C:\MinGW 下。
    • 在 C:\MinGW\bin 中应该有 gcc
    • 运行 cmd。
    • 在 boost (deflaut C:\boost_1_57_0) 主文件夹中
    • 使用命令设置路径:'set PATH=c:\mingw\bin;%PATH%'
    • 转到 boost 文件夹的 tools\build 目录并运行“bootstrap mingw”
    • 在根目录类型中构建系统库:
    • 'tools\build\b2 toolset=gcc --target-os=qnxnto --build-type=complete stage --with-system'
    • .a 文件将在 stage\libs 文件夹中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-06
      • 1970-01-01
      • 1970-01-01
      • 2012-11-07
      • 2021-10-16
      • 1970-01-01
      • 2020-03-25
      • 1970-01-01
      相关资源
      最近更新 更多