Skip to content

Instantly share code, notes, and snippets.

@nabijaczleweli
Created July 8, 2015 16:58
Show Gist options
  • Save nabijaczleweli/77c6cca9041b0ab43849 to your computer and use it in GitHub Desktop.
Save nabijaczleweli/77c6cca9041b0ab43849 to your computer and use it in GitHub Desktop.
Why LINUX-based OSs are bad
void f00() {
throw 'f';
}
void f00();
g++ -fPIC -std=c++14 -fvisibility=default -shared -Wl,-E asdf.cpp -olibasdf.so
#OR
g++ -fPIC -std=c++14 -fvisibility=default -c asdf.cpp
ar cr libasdf.a asdf.o
g++ -fPIC -std=c++14 -fvisibility=default -L. -lasdf usr.cpp -ousr.out
./usr.out
#include "asdf.hpp"
#include <iostream>
int main() {
try {
f00();
} catch(char c) {
std::cout << c << '\n';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment