c++ - Apple Mach-O linker error: Undefined symbols for architecture armv7 Google Protobuf -


i've been working on project contains 2 parts:

  1. a cocoa touch static library (.framework)
  2. a demo application uses (.framework) static library

i have learned .framework added .framework (i.e., opencv2.framework) must added demo application. i've learned build settings architectures must same , build settings search paths must set.

happy can be, i've been building , using .framework in demo application quite time. recently, i've added google protocol buffers .framework.

  1. my .framework compiling , seems in .framework.
  2. of course, demo application wasn't happy.

so i've added libprotobuf-lite.a demo application , added path header files in header search paths.

this should trick. instead, receive following errors , far have not been able find answer. here error log:

undefined symbols architecture armv7:   "vtable google_public::protobuf::message", referenced from:       google_public::protobuf::message::message() in test-remote-ios-aggregate(ftype.pb.o)   note: missing vtable means first non-inline virtual member function has no definition.   "typeinfo google_public::protobuf::message", referenced from:       typeinfo message::ftypemessage in test-remote-ios-aggregate(ftype.pb.o)       message::ftypemessage const* google_public::protobuf::internal::dynamic_cast_if_available<message::ftypemessage const*, google_public::protobuf::message const*>(google_public::protobuf::message const*) in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::message::gettypename() const", referenced from:       vtable message::ftypemessage in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::message::initializationerrorstring() const", referenced from:       vtable message::ftypemessage in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::message::spaceused() const", referenced from:       vtable message::ftypemessage in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::internal::reflectionops::merge(google_public::protobuf::message const&, google_public::protobuf::message*)", referenced from:       message::ftypemessage::mergefrom(google_public::protobuf::message const&) in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::internal::wireformat::verifyutf8stringfallback(char const*, int, google_public::protobuf::internal::wireformat::operation)", referenced from:       google_public::protobuf::internal::wireformat::verifyutf8string(char const*, int, google_public::protobuf::internal::wireformat::operation) in test-remote-ios-aggregate(ftype.pb.o)   "_objc_class_$_cvimageconverter", referenced from:       objc-class-ref in test-remote-ios-aggregate(idmessagecommand.o)   "google_public::protobuf::unknownfieldset::clearfallback()", referenced from:       google_public::protobuf::unknownfieldset::clear() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::message::discardunknownfields()", referenced from:       vtable message::ftypemessage in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::internal::wireformat::computeunknownfieldssize(google_public::protobuf::unknownfieldset const&)", referenced from:       message::ftypemessage::bytesize() const in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::internal::wireformat::serializeunknownfields(google_public::protobuf::unknownfieldset const&, google_public::protobuf::io::codedoutputstream*)", referenced from:       message::ftypemessage::serializewithcachedsizes(google_public::protobuf::io::codedoutputstream*) const in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::messagefactory::internalregistergeneratedfile(char const*, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&))", referenced from:       message::protobuf_adddesc_ftype_2eproto() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::internal::wireformat::skipfield(google_public::protobuf::io::codedinputstream*, unsigned int, google_public::protobuf::unknownfieldset*)", referenced from:       message::ftypemessage::mergepartialfromcodedstream(google_public::protobuf::io::codedinputstream*) in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::unknownfieldset::mergefrom(google_public::protobuf::unknownfieldset const&)", referenced from:       message::ftypemessage::mergefrom(message::ftypemessage const&) in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::internal::generatedmessagereflection::generatedmessagereflection(google_public::protobuf::descriptor const*, google_public::protobuf::message const*, int const*, int, int, int, google_public::protobuf::descriptorpool const*, google_public::protobuf::messagefactory*, int)", referenced from:       message::protobuf_assigndesc_ftype_2eproto() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::message::~message()", referenced from:       message::ftypemessage::ftypemessage() in test-remote-ios-aggregate(ftype.pb.o)       message::ftypemessage::~ftypemessage() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::unknownfieldset::unknownfieldset()", referenced from:       message::ftypemessage::ftypemessage() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::message::checktypeandmergefrom(google_public::protobuf::messagelite const&)", referenced from:       vtable message::ftypemessage in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::descriptorpool::generated_pool()", referenced from:       message::protobuf_assigndesc_ftype_2eproto() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::descriptorpool::internaladdgeneratedfile(void const*, int)", referenced from:       message::protobuf_adddesc_ftype_2eproto() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::message::serializetoostream(std::__1::basic_ostream<char, std::__1::char_traits<char> >*) const", referenced from:       message::testmessaging::ftypemessage(void const*, unsigned long) in test-remote-ios-aggregate(testmessaging.o)   "google_public::protobuf::messagefactory::internalregistergeneratedmessage(google_public::protobuf::descriptor const*, google_public::protobuf::message const*)", referenced from:       message::(anonymous namespace)::protobuf_registertypes(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::internal::wireformat::serializeunknownfieldstoarray(google_public::protobuf::unknownfieldset const&, unsigned char*)", referenced from:       message::ftypemessage::serializewithcachedsizestoarray(unsigned char*) const in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::descriptorpool::findfilebyname(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:       message::protobuf_assigndesc_ftype_2eproto() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::messagefactory::generated_factory()", referenced from:       message::protobuf_assigndesc_ftype_2eproto() in test-remote-ios-aggregate(ftype.pb.o)   "google_public::protobuf::unknownfieldset::~unknownfieldset()", referenced from:       message::ftypemessage::ftypemessage() in test-remote-ios-aggregate(ftype.pb.o)       message::ftypemessage::~ftypemessage() in test-remote-ios-aggregate(ftype.pb.o) ld: symbol(s) not found architecture armv7 clang: error: linker command failed exit code 1 (use -v see invocation) 

any ideas on issue here?

thank you.

it looks linker not running on .framework, , .proto files built full libprotobuf instead of libprotobuf-lite.

try adding fat libprotobuf.a app's framework folder , see if finds symbols.

as side note, have error in there didn't mention: "_objc_class_$_cvimageconverter", referenced from: objc-class-ref in test-remote-ios-aggregate(idmessagecommand.o)

not sure how fix 1 without seeing code.


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -