POCO链接错误,OS X 10.11.2上体系结构x86_64的未定义符号
POCO Linking error, undefined symbols for architecture x86_64 on OS X 10.11.2
我使用Homebrew安装了POCO
有人建议使用stdlibc++,但当我这样做时,除了POCO链接错误之外,我还会收到一堆std链接错误
我还尝试使用Homebrew的gcc中的g++而不是苹果的g++,但这会产生同样的错误。
生成文件
CXX=g++
RM=rm -f
CXXFLAGS=-std=c++11 -Wall -O3 -I/usr/local/opt/openssl/include -I/usr/local/Cellar/poco/1.6.1/include
LDFLAGS=-L/usr/local/opt/openssl/lib -L/usr/local/Cellar/poco/1.6.1/lib
LDLIBS=-lPocoNet -lPocoFoundation
SRCS=eml.cc
OBJS=$(subst .cc,.o,$(SRCS))
all: eml
eml: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o eml $(OBJS) $(LDLIBS)
%.o: %.c
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
$(RM) eml $(OBJS)
错误
g++ -std=c++11 -stdlib=libc++ -Wall -O3 -I/usr/local/opt/openssl/include -I/usr/local/Cellar/poco/1.6.1/include -L/usr/local/opt/openssl/lib -L/usr/local/Cellar/poco/1.6.1/lib -o eml eml.o -lPocoNet -lPocoFoundation -lcrypto
Undefined symbols for architecture x86_64:
"Poco::Net::SSLManager::initializeClient(Poco::SharedPtr<Poco::Net::PrivateKeyPassphraseHandler, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Net::PrivateKeyPassphraseHandler> >, Poco::SharedPtr<Poco::Net::InvalidCertificateHandler, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Net::InvalidCertificateHandler> >, Poco::AutoPtr<Poco::Net::Context>)", referenced from:
_main in eml.o
"Poco::Net::SSLManager::instance()", referenced from:
_main in eml.o
"Poco::Net::initializeSSL()", referenced from:
_main in eml.o
"Poco::Net::uninitializeSSL()", referenced from:
_main in eml.o
"Poco::Net::SecureStreamSocket::SecureStreamSocket(Poco::Net::SocketAddress const&)", referenced from:
_main in eml.o
"Poco::Net::SecureStreamSocket::~SecureStreamSocket()", referenced from:
_main in eml.o
"Poco::Net::AcceptCertificateHandler::AcceptCertificateHandler(bool)", referenced from:
_main in eml.o
"Poco::Net::Context::Context(Poco::Net::Context::Usage, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Net::Context::VerificationMode, int, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in eml.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [eml] Error 1
您没有链接所有必需的库。所有未解决的在CCD_ 1中定义符号。若要安装此库,必须生成POCO库的完整版本,而不是基本版本。
如果你查阅任何POCO API的文档,它会告诉你需要链接的库,例如CCD_ 2。
相关文章:
- vscode g++链路故障:体系结构x86_64的未定义符号
- 体系结构x86_64的未定义符号:std:terminate(),typeinfo,运算符delete[],运算符new
- OSX clang++:用于 cpp 文件中显式实例化模板的体系结构x86_64的未定义符号
- PCL 出错:体系结构x86_64 @pcl的未定义符号
- clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) - 体系结构的未定义符号 x86_64:
- 体系结构x86_64的未定义符号:链接器错误
- C++ std::vector<int> 体系结构的未定义符号 x86_64:
- 未使用的 asm() 在不受支持的体系结构上的行为
- 用于本地网络运行的客户端服务器体系结构
- 生成文件:体系结构x86_64的未定义符号
- Xcode"体系结构x86_64的未定义符号"
- 有了memory_order_relaxed,原子变量的总修改顺序如何在典型体系结构上得到保证
- 体系结构x86_64的未定义符号:找不到原因
- Apple Mach-O-Linker 错误:在体系结构 x86-64 中找不到从(行)引用的变量
- 在英特尔x86体系结构上使用非AVX指令修改xmm整数寄存器值
- X86体系结构中的CPUID
- arm和x86体系结构中的c/c++语言有什么不同
- 使用c++以及x86和x64体系结构访问处理器中断
- x86 体系结构上的内存排序限制
- 为什么是32位x86体系结构上“int64_t”8字节的默认对齐方式