1

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.

Community
  • 1
  • 1

1 Answers1

2

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.

Bathsheba
  • 231,907
  • 34
  • 361
  • 483
  • I'd be surprised if the versions from the official repositories are not compatible (although not *that* surprised). Maybe just some compiler flag is necessary? – BoBTFish Dec 11 '15 at 08:40
  • I still wouldn't chance it. In particular, there is so much flexibility in classes like `std::string`; an almost exact compiler flag set has to be used. Taking the time to learn b2 (come on, it's much simpler than the old bjam ;-)) is time well-spent. – Bathsheba Dec 11 '15 at 08:42
  • @Bathsheba could you say more about it? I don't understand but it seems to be interesting. Especially it caught my eye: "Taking the time to learn b2 (come on, it's much simpler than the old bjam ;-)) is time well-spent." What is b2? What is bjam? – user5468942 Dec 11 '15 at 10:09
  • Start with www.boost.org and go from there. Do reserve 2 days to get this working though. – Bathsheba Dec 11 '15 at 10:18