The following code snippet . . .
try {
luabind::call_function<void>(state, fName.c_str());
} catch (luabind::error& e) {
std::cerr << "Error calling function, \"" << fName << "\":\n";
std::cerr << e.what() << ": " << lua_tostring(state, -1) << "\n";
lua_pop(state, 1);
assert(false);
}
. . . catches runtime errors just fine when compiled as . . .
g++ main.cpp -llua -lluabind -ohw
. . . but bails out with an uncaught exception when compiled using
g++ main.cpp -llua -lluabind -ohw -std=c++11
Why?
FYI
$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix