User defined boost lib in netbeans C ++ projects?

I am using boost for my project. I have a user account ( without sudo permission ) with boost 1.41, and my project needs at least 1.53, so I want to use my own boost-build directory to compile my program. I have successfully created momentum in my system. But I do not know how to associate them with my executable file. I use Jamfiles to compile the code.

I have already done this successfully with individual files. For instance.

#include <boost/version.hpp>

#include <iostream>
using namespace std;
int main()
{
    cout << "Boost version: " << BOOST_LIB_VERSION << endl;
    return 0;
}

But when I compile and run it with the command:

[user@server ~]$ g++ -std=c++11 test.cpp 
[user@server ~]$ ./a.out 
Boost version: 1_40

And if I do it like this:

[user@server ~]$ g++ -I boost_1_53_0/  test.cpp -L~/boost/stage/lib
[user@server ~]$ ./a.out 
Boost version: 1_53

, boost, boost lib. , NB, Jamfile Jamroot.

Jamroot lib , :

lib boost_system : :
        <link>shared
        <name>boost_system ;

lib boost_thread : :
        <link>shared
        <name>boost_thread ;

lib boost_program_options : :
        <link>shared
        <name>boost_program_options ;

lib boost_iostreams : :
        <link>shared
        <name>boost_iostreams ;

, "//". .

Boost Directory:

boost_1_53_0
    ...
    stage/lib/[lib files]

-Dir:

build-dir/boost/bin.v2/
    config.log
    libs/

: lib

lib boost_iostreams : :
            <link>shared
            <search>"path/to/boost"
            <name>boost_iostreams ;

, !

+4

Source: https://habr.com/ru/post/1659819/


All Articles