Boost logo

Boost Users :

Subject: [Boost-users] exception problem with boost::filesystem under cygwin
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2011-07-17 12:20:13


Hello,

I'm using boost::filesystem within my project (boost 1.47.0). I have compiled the boost under cygwin with bjam. I have some problems with exception throws / catches:
The following example shows the problem:

#include <stdexcept>
#include <boost/filesystem.hpp>

int main(int argc, char* argv[]) {
    throw std::runtime_error("xxx");
        
        return 0;
}

If I compile this code under Cygwin and link cygboost_filesystem and cygboost_system, the programs terminates with this messages:
terminate called after throwing an instance of 'std::runtime_error'
terminate called recursively

If I remove the boost/filesystem include the program produce the correct message:
terminate called after throwing an instance of 'std::runtime_error'
  what(): xxx

If I change the program to:

int main(int argc, char* argv[]) {
        try {
                throw std::runtime_error("xxx");
        } catch (...) {}
        return 0;
}

the program breaks down with the filesystem include:
terminate called after throwing an instance of 'std::runtime_error'
terminate called recursively

without the include always works fine.

Can anyone help me to solve the problem?

Thanks a lot

Phil


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net