First version, now it compiles with g++. 
Still a lot of warnings to remove.