Good day. Help is needed!

I want to install the boost library. In all tutorials, people go to the Visual Studio Command Prompt (2010) console. But the problem is that I can not find it! I tried to search in Windows - I did not find it.

I have an express version! Is that the case?

    3 answers 3

    The boost library is a collection of partially compiled source codes. In some cases, you do not need to collect anything, just download the distribution from the official website, place it in a convenient place and specify the paths in the project settings.

    In my special folder where I store the reusable libraries, the sub- boost_1_56_0 . Next to her are a number of other older versions of this library.

    In environment variables (in windows it is in the same place as PATH) I add the variable BOOST_ROOT , which points to the latest build. Those. as a new one appears, I will create a folder boost_1_XX_Y and reassign this variable.

    In the settings of any projects, I just need to specify $ (BOOST_ROOT) \ include - to access the headers, and $(BOOST_ROOT)\stage\lib32 / $(BOOST_ROOT)\stage\lib64 to access specific libraries that I need.

    Since boost automatically gives the names of the libraries to be assembled, taking into account the compilers with which they are built, even if you have different compilers, it is convenient to drop binaries into one folder, as indicated above.

    • With Intel Compiler you get libboost_name-iw-type-version.lib .
    • With Visual Studio, you will libboost_name-vcXX-type-version.lib , where XX is the version of the visual studio compiler (not the studio, but the compiler).
    • With MinGW with gcc, you get libboost_name-gcc-type-version.lib , if my memory serves me.

    In this case, to build libraries that need to be built, you must perform the same actions in the console:

    • For Intel Compiler, this will be in the appropriate Command Prompt.
    • For Visual Studio, this will be in the appropriate Command Prompt.
    • For MinGW, this will be in a regular console, if, of course, the path to the bin in MinGW is added to the PATH environment variable.

    Actions must be the same. First bootstrap.bat , and then b2 --help .

    In the b2 help, you will see all the options for setting up the assembly in order to build the most convenient way for you.

    The line will look like this:

    b2 parameter1 parameter2 parameter3 ...

    • toolset - it should be indicated so that the assembly is made by a specific compiler (gcc, intel, visual studio), and you can also specify the version of the compiler.
    • variant, build type, debug or release. For development you need both options.
    • link - You choose whether your binary code will turn into a dll or contain "in itself" all the algorithms used.
    • threading - to be honest, I don’t understand the meaning of this directive and always indicate multi. We rarely write single-threaded applications.
    • runtime-link - the same as link, only for runtime.
    • address-model - the parameter is not specified in the help, but it helps to choose the architecture of the collected libraries.
    • Stage / install, differ only in that install will allow you to "unload" only the necessary in a separate folder, stage collects everything where it is. If you are not fond of changes in source boost, the stage will do for you.

    The result is something like this:

     b2 toolset=vc120 variant=debug link=shared threading=multi runtime-link=shared address-model=32 stage 

    For debug in x32 and such:

     b2 toolset=vc120 variant=release link=static threading=multi runtime-link=shared address-model=32 stage 

    For release in x32.

    Wait about 40 minutes, enjoy the result. In case of problems - google, most likely already thousands of people have encountered your problem, and its solution is inattention or some specific settings of something. For example, when building a boost, python gets many MinGW warning s due to a conflict of headers, such things can be resolved privately.

    Having spent 2 hours trying to figure it out once, you will never depend on any third-party assemblies, you will understand where you have what lies, who put it there, etc. In general, it is useful.

    PS: Command Prompt is located in Visual Studio Tools. Or look in VStudio_PATH \ CommonXX \ Tools \ VsDevCmd.bat

    • one
      Wow, this is a detailed tutorial. - VladD
    • one
      @Arkady: Even though I got it, I want to thank you separately for such an explanation! Thank you so much! - sys_dev

    Probably the easiest way is to install a prebuilt package under your compiler. Take here .

      There is a program called BlueGo, at: link . This is a collection of various libraries, including the boost, but plus it is that there are absolutely all versions, from the old to the new. You choose the version, choose what to compile, choose the composition of the assembly and wait for the end.