fixed building for gcc
added libstdc++, fixed tests