我正在尝试使用clang ++在osx 10.9上构建poco库
我正在运行make CXXFLAGS+=-stdlib=libstdc++ CFLAGS+=-stdlib=libstdc++ LDFLAGS+=-stdlib=libstdc++
它已经成功编译了所有.o文件:
**编译src / UUIDGenerator.cpp(发布,共享)clang ++ -Iinclude -I / Users / croco / Work / poco-1.6.0-all / CppUnit / include -I / Users / croco / Work / poco- 1.6.0-all / CppUnit / WinTestRunner / include -I / Users / croco / Work / poco-1.6.0-all / Foundation / include -I / Users / croco / Work / poco-1.6.0-all / XML /包括-I / Users / croco / Work / poco-1.6.0-all / JSON / include -I / Users / croco / Work / poco-1.6.0-all / Util / include -I / Users / croco / Work / poco-1.6.0-all / Net / include -I / Users / croco / Work / poco-1.6.0-all /加密/包含-I / Users / croco / Work / poco-1.6.0-all / NetSSL_OpenSSL /包括-I / Users / croco / Work / poco-1.6.0-all / Data / include -I / Users / croco / Work / poco-1.6.0-all / Data / SQLite / include -I / Users / croco / Work / poco-1.6.0-all / Data / ODBC / include -I / Users / croco / Work / poco-1.6.0-all / Data / MySQL / include -I / Users / croco / Work / poco-1.6。 0-all / MongoDB / include -I / Users / croco / Work / poco-1.6.0-all / Zip / include -I / Users / croco / Work / poco-1.6.0-all / PageCompiler / include -I / Users / croco / Work / poco-1.6.0-all / PageCompiler / File2Page / include -stdlib = libstdc ++ -DNDEBUG -O2 -fasm-blocks -fPIC -c src / UUIDGenerator.cpp -o /Users/croco/Work/poco-1.6.0-all/Foundation/obj/Darwin/x86_64/release_shared/UUIDGenerator.o
但是在链接时,-stdlib
标志没有使用,我收到一些错误:
架构x86_64的未定义符号:
“的std :: basic_string的, std :: allocator> :: data()const“,引自: Poco :: UnicodeConverter :: convert(std :: basic_string,std :: allocator> const&amp ;,, UnicodeConverter.o中的std :: string&)“std :: basic_string,std :: allocator> :: length()const”, 引自: Poco :: UnicodeConverter :: convert(std :: basic_string,std :: allocator> const&amp ;,, UnicodeConverter.o中的std :: string&)
我做错了什么?
答案 0 :(得分:1)
好吧,我的解决方案是将-stdlib
标记放到build/config/Darwin-clang
并使用必需的Darwin-clang
配置配置构建。