I tried to compile the following code on ubuntu 11.04:
#include #include int main()
Just adding to @anio's answer:
While linking, the -lrt flag may need to be added at the end of the command. Try:
g++ -L /lib shared.o -o shared -lrt