Linux build works with g++ and valgrind only