You are writing a game in, say GLFW or SDL. Somehow you want to show a fatal error message to the user, preferrably in native style. How?
- On Windows, you can simply call
MessageBox()
to show such message. - On Linux, you can use the method below.
- On other platforms, well it's your homework.
Just compile it without any flags should work.
# Use gcc
g++ message-box.cpp
./a.out
# Use clang
clang++ message-box.cpp
./a.out
If there are any linking error, you may need to supply -ldl
to the compiler.