fix g++ linkage