Code:

#include <iostream> #include <exception> #include <stdexcept> int main() { std::cout << "HW\n"; try { std::cout << "Block\n"; throw std::runtime_error("Point 1"); std::cout << "Block Done\n"; } catch (std::exception const& e) { std::cout << "E: " << e.what() << "\n"; } catch (...) { std::cout << "E: Unknown\n"; } std::cout << "Done\n"; }

If I compile normally, it works as expected:

> g++ main.cpp > # ./a.exe HW Block E: Point 1 Done

But when you use the -mcmodel=large flag an exception caused terminate() to be called.

> g++ -mcmodel=large main.cpp > ./a.exe HW Block terminate called after throwing an instance of 'std::runtime_error' what(): Point 1

I assume this is because it is linking against some incompatible libs. But not sure how to fix it.

All the packages I have installed:

autoconf automake make git gperf coreutils vim mingw-w64-x86_64-jq mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-libyaml mingw-w64-x86_64-dlfcn mingw-w64-x86_64-snappy mingw-w64-x86_64-libevent mingw-w64-x86_64-boost cmake ninja

wohlstad's user avatar

wohlstad

36.9k18 gold badges79 silver badges114 bronze badges

Loki Astari's user avatar

3

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.