Making a SFML2 Applcation with Clang, libc++ and c++11. Undefined Reference to SFML Library

╄→гoц情女王★ 提交于 2019-12-06 13:20:30

The SFML2 library has been compiled against some C++ library other than libc++ (perhaps libstdc++?). To correct, recompile SFML2 with -stdlib=libc++, and be sure the linker sees -stdlib=libc++ when linking SFML2 to your application.

The key to debugging this is noting that the linker is looking for sf::Window::create with std::__1 symbols. And libc++ mangles things with std::__1. But other std::libs mangle things with just std. This is a safety feature to keep you from accidentally mixing std::string from two different std::libs and ending up with a run time error instead of a link time error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!