简体   繁体   中英

Compiling Modular Boost 1.55.0 with Submodule Application

I've cloned the modulare boost git repository (liked described here: description , but not only headers) onto my windows machine (Windows 7 64 bit, using MinGW g++ 4.4.1 but also tried version 4.8.1). I used the following commands:

git config --global core.autocrlf true
git clone --recursive git@github.com:boostorg/boost.git modular-boost > clone.log
cd modular-boost

Before building it, i added the submodule boost.application into libs/application:

git submodule add https://github.com/retf/Boost.Application.git libs/application

After inserting the submodule, building it:

.\bootstrap gcc
.\b2 --layout=tagged link=shared variant=debug threading=multi toolset=gcc
  1. Some libraries didn't compile (like boost log). Did I miss here something?
  2. I tried to work with the existing compiled libraries (mainly I am using System, Thread, Prg_Exec_Monitor, Unit Tests and Program Options), but I always get an error in boost/asio/detail/impl/socket_ops.ipp :

     error: 'SO_UPDATE_CONNECT_CONTEXT' was not declared in this scope 

    Here is an example code, where this error occurs:

     #include <iostream> #include <boost/application.hpp> using namespace std; int main() { cout << "SO_Question_Test" << endl; return 0; } 

    _WIN32_WINNT is set to 0x0601 (Windows 7).

I added partial support for MinGW. Please download the last version again (0.4.9) and check this:

Build Boost.Application on MinGW steps:

1) Download MinGW

2) Install it, and add 'C:/MinGW/bin' to your PATH.

3) Install gcc -> open a console window and type:

mingw-get install gcc

4) Build Boost for MinGW

From your boost_X_XX_X directory, go to

.\\tools\\build\\v2

in my case : C:\\boost_1_54_0\\tools\\build\\v2

and type:

bootstrap.bat mingw

cd C:\\boost_1_54_0\\tools\\build\\v2

bootstrap.bat mingw

Return to your boost_X_XX_X directory and type:

bjam toolset=gcc

5) Install Boost.TypeIndex 4.0 (for boost < 1.56)

If you are using boost < 1.56 you need install Boost.TypeIndex 4.0

5.1) Download it

5.2) Copy content of: c:\\type_index\\include\\boost\\ to C:\\boost_1_54_0\\boost\\

6) Install Boost.Application 0.4.9

6.1) Download it

6.2) Copy content of: c:\\application\\include\\boost\\ to C:\\boost_1_54_0\\boost\\

7) Install, compile and run "tests" **

7.1) Create a new folder called "application" inside C:\\boost_1_54_0\\libs\\

7.2) Copy folder: c:\\application\\test to C:\\boost_1_54_0\\libs\\appliacation

c:\\application*

7.3) Compile and run:

cd C:\\boost_1_54_0\\libs\\application\\test

bjam toolset=gcc define=BOOST_APPLICATION_FEATURE_NS_SELECT_BOOST

Use BOOST_APPLICATION_FEATURE_NS_SELECT_BOOST to force use of boost (boost::shared_ptr, boost::unordered_map and so on) as default

8) Install, compile and run "example"

8.1) Create a new folder called "application" inside C:\\boost_1_54_0\\libs\\

8.2) Copy folder: c:\\application\\example to C:\\boost_1_54_0\\libs\\application

8.3) Compile and run:

cd C:\\boost_1_54_0\\libs\\application\\example

bjam toolset=gcc

The examples defines 'BOOST_APPLICATION_FEATURE_NS_SELECT_BOOST' direct on code

[*] c:\\application = your download from github

[**] The "bjam" needs to be available in the system

Article: https://github.com/retf/Boost.Application/wiki/Boost.Application-on-MinGW

Letme know if work!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM