Make header and demos compatible with C++
Fix static linking