c++ubuntuboostb2

C++: All boost path operations segfault ( Ubuntu / g++ )


Introduction I know about C++: All boost path operations segfault (OSX / GCC)

And as you can I didn't changed convention of name subject.

But I am using a Ubuntu system and I have a problem like author above.

I don't understand above solution ( How to solve it? ) ( And I use another system ) so I create my own subject.

To sum up:

The problem appear for example when I run :

int main(){
    std::string s = boost::filesystem::current_path().string(); //SIGESV
    return 0;
}

Debugger said:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffefb57f7e in ?? () from /lib/x86_64-linux-gnu/libc.so.6

Please help me.


Solution

  • The pre-built boost libraries that you installed are not compatible with the C++ standard library that ships with your compiler.

    You should build the boost binaries yourself using the tools they provide.

    It does take some effort (I remember a couple of days of sheer frustration) to get used to their build tool, but it's well worth taking the time. The boost documentation is much better than it once was.