lxg

导航

 

引自:https://blog.csdn.net/ninglu1989/article/details/82425595

一、编译boost源码为静态库

1>将你的Qt的工具目录(有g++.exe)设置环境变量。(我的是 F:\Qt592\Tools\mingw530_32\bin,要依据实际情况)

      2>下载boost源码并解压(如boost_1_65_1.zip)

      3>在命令行进入boost_1_65_1/tools/build/src/engine

   4>执行 build.bat gcc,在当前目录将会生成bin.ntx86文件夹,里面包含两个exe文件b2.exe,bjam.exe

   5>将bin.ntx86\bjam.exe拷贝到E:\boost_1_65_1

   6>change dir 进入boost_1_65_1

   7>执行命令 bjam "toolset=gcc" install,执行命令会在C盘根目录下生成一个Boost文件夹。我们要使用的头文件与lib就在里边。

   8>将7>中生成的 Boost 里的 boost文件夹拷贝到qt 的include下面(我的在 F:\Qt592\5.9.2\mingw53_32\include)

     9>将7>中生成的 Boost 里的 lib下.a文件拷贝到 qt lib目录下 (我的在 F:\Qt592\5.9.2\mingw53_32\lib)

二,测试thread库

LIBS += -L$$PWD/../../build-LoadDll-Desktop_Qt_5_14_2_MinGW_64_bit-Debug/Main/debug \

        -llibboost_thread-mgw73-mt-x64-1_70
LIBS += -lws2_32
三:报错undefined reference to `__imp_WSAStartup' 加上LIBS += -lws2_32


posted on 2021-01-19 12:14  lxg_7105  阅读(271)  评论(0编辑  收藏  举报