本文介绍了构建ARM64时,体系结构x86_64的未定义符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了cryptopp lib以用于ios应用程序。但是没有用,只告诉我

I built the cryptopp lib to using for an ios application. but isn't working , only told me

等等......

我遵循Crypopp wiki页面的指南,但它仍然崩溃。

and I follow the Crypopp wiki page's guideline, but it still crashing.

我该如何解决这个问题?

how can I fix that?






我尝试使用但它也不起作用。它会发生如下错误:


I tried to build with github's prebuilt cryptopp but it doesn't work, too. it occur errors like below:

 vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o
 vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o

CryptoPP :: Filter :: CopyRangeTo2(CryptoPP :: BufferedTransformation& ;, unsigned long long&a mp;,unsigned long long,std :: string const&,bool)const,引自:

"CryptoPP::Filter::CopyRangeTo2(CryptoPP::BufferedTransformation&, unsigned long long&, unsigned long long, std::string const&, bool) const", referenced from:

 vtable for CryptoPP::Base64Decoder in MYCLASSBBB.o
 vtable for CryptoPP::Unflushable<CryptoPP::Filter> in MYCLASSBBB.o
 vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o
 vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o

CryptoPP :: Filter :: TransferTo2(CryptoPP :: BufferedTransformation& ;, unsigned long long&,std :: string const&,bool),引自:

"CryptoPP::Filter::TransferTo2(CryptoPP::BufferedTransformation&, unsigned long long&, std::string const&, bool)", referenced from:

 vtable for CryptoPP::Base64Decoder in MYCLASSBBB.o
 vtable for CryptoPP::Unflushable<CryptoPP::Filter> in MYCLASSBBB.o
 vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o
 vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o

CryptoPP :: BufferedTransformation :: ChannelPut2(std :: string const& ;, unsigned char const *,unsigned long,int,bool),引用自:

"CryptoPP::BufferedTransformation::ChannelPut2(std::string const&, unsigned char const*, unsigned long, int, bool)", referenced from:

 vtable for CryptoPP::Base64Decoder in MYCLASSBBB.o
 vtable for CryptoPP::Unflushable<CryptoPP::Filter> in MYCLASSBBB.o
 vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o
 vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o

CryptoPP :: BufferedTransformation :: ChannelCreatePutSpace(std :: string const& ;, unsigned long&),引自:

"CryptoPP::BufferedTransformation::ChannelCreatePutSpace(std::string const&, unsigned long&)", referenced from:

 vtable for CryptoPP::Base64Decoder in MYCLASSBBB.o
 vtable for CryptoPP::Unflushable<CryptoPP::Filter> in MYCLASSBBB.o
 vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o
 vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o

CryptoPP :: BufferedTransformation :: ChannelPutModifiable2(std :: string const& ;, unsigned char *,unsigned long,int,bool),引用自:

"CryptoPP::BufferedTransformation::ChannelPutModifiable2(std::string const&, unsigned char*, unsigned long, int, bool)", referenced from:

 vtable for CryptoPP::Base64Decoder in MYCLASSBBB.o
 vtable for CryptoPP::Unflushable<CryptoPP::Filter> in MYCLASSBBB.o
 vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o
 vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o

CryptoPP :: BufferedTransformation :: ChannelMessageSeriesEnd(std :: string const&,int ,bool),引用自:

"CryptoPP::BufferedTransformation::ChannelMessageSeriesEnd(std::string const&, int, bool)", referenced from:

 vtable for CryptoPP::Base64Decoder in MYCLASSBBB.o
 vtable for CryptoPP::Unflushable<CryptoPP::Filter> in MYCLASSBBB.o
 vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o
 vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o

CryptoPP :: BufferedTransformation :: SetRetrievalChannel(std :: string const&) ,引用自:

"CryptoPP::BufferedTransformation::SetRetrievalChannel(std::string const&)", referenced from:

 vtable for CryptoPP::Base64Decoder in MYCLASSBBB.o
 vtable for CryptoPP::Unflushable<CryptoPP::Filter> in MYCLASSBBB.o
 vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o
 vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o

CryptoPP :: StringSinkTemplate :: StringSinkTemplate(std :: string&),引自:

"CryptoPP::StringSinkTemplate::StringSinkTemplate(std::string&)", referenced from:

 encryptString(std::string const&) in MYCLASSBBB.o
 decryptString(std::string const&, int) in MYCLASSBBB.o
 MYCLASSAAA::setDeviceId() in MYCLASSAAA.o
 MYCLASSAAA::getSignature() in MYCLASSAAA.o

ld:找不到架构arm64的符号
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

MYCLASSAAA和MYCLASSBBB都是使用cryptopp lib的类。

the MYCLASSAAA and MYCLASSBBB are all of classes what using cryptopp lib.

我会尝试自己构建lib,但我认为可能会发生相同的错误。我想做什么?

I'll try to build the lib myself, but I think it maybe same errors happen. what I suppose to do?

和项目设置 - 我没有在Apple LLVM 6.0 - 语言中将Compile Sources As更改为Objective-C ++,I刚设置为根据文件类型。它必须是客观的-c ++?当我改变它时,它在另一个源中出现太多错误。因为它是cocos2d-x的遗留项目(0.12.0 / c ++项目)......

and project settings -- I didn't changed "Compile Sources As" to Objective-C++ at "Apple LLVM 6.0 - language", I just setted that to "According to File Type". it must be objective-c++? when I change to that, it occur too many errors in another sources. because it is legacy project of cocos2d-x(0.12.0 / c++ project)...

我希望你的帮助。谢谢。

I hope your help. thanks.

推荐答案

我解决了这个问题---简而言之,它必须用-stdlib = libstdc ++标志构建(到CXXFLAGS in GNUMAKEFILE)在构建libcryptopp时。

I solved this--- in short, it have to build with -stdlib=libstdc++ flag(to CXXFLAGS in GNUMAKEFILE) when building libcryptopp.

因为我的项目是遗留的cocos2d-x项目,所以标准库被设置为libstdc ++。

because my project is legacy cocos2d-x project, that's standard library is setted to libstdc++.

更多信息是。杰弗里非常详细地回答了我。

more infomation is here. jeffrey answered me about this in great detail.

这篇关于构建ARM64时,体系结构x86_64的未定义符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 20:05