Try to link stdc++ too, lets see if that is the culprit.