mardi 4 septembre 2018

Undefined symbols for architecture OpenHome iOS

I have Build and generate the Fat Libraries for the OpenHome by running the "Makefile" and by using "lipo" with all the .a by platforms.

The only changes I made to the "Makefile" are:

platform_cflags = -I$(sdkroot)/usr/include/ -miphoneos-version-min=2.2 -pipe -no-cpp-precomp -isysroot $(sdkroot) -DPLATFORM_MACOSX_GNU -DPLATFORM_IOS

to

platform_cflags = -I$(sdkroot)/usr/include/ -miphoneos-version-min=7.0 -pipe -no-cpp-precomp -isysroot $(sdkroot) -DPLATFORM_MACOSX_GNU -DPLATFORM_IOS

in line 169 and

nocpp11=no

the lipo -info shows

Architectures in the fat file: libohNetCore.a are: armv7 i386 x86_64 arm64 

I know the libraries are compiled wit libc++ because I have also run this command and that's the result

nm libohNetCore.a | c++filt | grep string | head -1
0000000000000110 T OpenHome::Net::CpDeviceCpp::GetAttribute(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const

The header files generated by the library have been imported using a Module because I am working on a Framework.

module OHNet[system]{

header "OHNet/include/OpenHome/Net/C/CpStack.h"
...

export *

}

The Apple LLVM 9.0 language c++ has been setup to libc++

However, I am facing an issue when I tried to compile.

Undefined symbols for architecture arm64:

"___cxa_guard_abort", referenced from:
      OpenHome::Net::OutputProcessorUpnp::ProcessBool(OpenHome::Brx const&, bool&) in libohNetCore.a(ProtocolUpnp.o)
      OpenHome::Net::DviSubscription::Log(OpenHome::IWriter&) in libohNetCore.a(DviSubscription.o)
      OpenHome::Net::PropertyWriter::WriteVariableStart(OpenHome::IWriter&, OpenHome::Brx const&) in libohNetCore.a(DviSubscription.o)
      OpenHome::Net::PropertyWriter::WriteVariableEnd(OpenHome::IWriter&, OpenHome::Brx const&) in libohNetCore.a(DviSubscription.o)
      OpenHome::Net::DviProtocolUpnp::GetAttribute(char const*, char const**) const in libohNetCore.a(DviProtocolUpnp.o)
      OpenHome::Net::DviProtocolUpnpServiceXmlWriter::GetRelatedVariableName(OpenHome::Bwh&, OpenHome::Brx const&, OpenHome::Brx const&) in libohNetCore.a(DviProtocolUpnp.o)
  "___cxa_get_exception_ptr", referenced from:
      OpenHome::Net::InvocationUpnp::WriteRequest(OpenHome::Uri const&) in libohNetCore.a(ProtocolUpnp.o)
      OpenHome::Net::OutputProcessorUpnp::ProcessBool(OpenHome::Brx const&, bool&) in libohNetCore.a(ProtocolUpnp.o)
      OpenHome::Net::MdnsPlatform::Listen() in libohNetCore.a(MdnsPlatform.o)
      OpenHome::Net::HeaderSoapAction::Process(OpenHome::Brx const&) in libohNetCore.a(DviServerUpnp.o)
      OpenHome::Net::HeaderCallback::Process(OpenHome::Brx const&) in libohNetCore.a(DviServerUpnp.o)
      OpenHome::Net::DviSessionUpnp::InvocationReadBool(char const*) in libohNetCore.a(DviServerUpnp.o)
  "std::out_of_range::~out_of_range()", referenced from:
      std::__1::map<OpenHome::Brn, unsigned int, OpenHome::BufferCmp, std::__1::allocator<std::__1::pair<OpenHome::Brn const, unsigned int> > >::at(OpenHome::Brn const&) in libohNetCore.a(ShellCommandDebug.o)
  "std::length_error::~length_error()", referenced from:
      std::__1::__split_buffer<OpenHome::MListener*, std::__1::allocator<OpenHome::MListener*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<OpenHome::MListener*>&) in libohNetCore.a(Env.o)
      std::__1::__split_buffer<OpenHome::ISuspendObserver*, std::__1::allocator<OpenHome::ISuspendObserver*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<OpenHome::ISuspendObserver*>&) in libohNetCore.a(Env.o)
      std::__1::__split_buffer<OpenHome::IResumeObserver*, std::__1::allocator<OpenHome::IResumeObserver*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<OpenHome::IResumeObserver*>&) in libohNetCore.a(Env.o)
      std::__1::unique_ptr<std::__1::__tree_node<std::__1::__value_type<OpenHome::IStackObject*, OpenHome::IStackObject*>, void*>, std::__1::__tree_node_destructor<std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<OpenHome::IStackObject*, OpenHome::IStackObject*>, void*> > > > std::__1::__tree<std::__1::__value_type<OpenHome::IStackObject*, OpenHome::IStackObject*>, std::__1::__map_value_compare<OpenHome::IStackObject*, std::__1::__value_type<OpenHome::IStackObject*, OpenHome::IStackObject*>, std::__1::less<OpenHome::IStackObject*>, true>, std::__1::allocator<std::__1::__value_type<OpenHome::IStackObject*, OpenHome::IStackObject*> > >::__construct_node<std::__1::pair<OpenHome::IStackObject*, OpenHome::IStackObject*> >(std::__1::pair<OpenHome::IStackObject*, OpenHome::IStackObject*>&&) in libohNetCore.a(Env.o)
      std::__1::__split_buffer<char const*, std::__1::allocator<char const*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char const*>&) in libohNetCore.a(OhNet.o)
      std::__1::__split_buffer<OpenHome::Net::Argument*, std::__1::allocator<OpenHome::Net::Argument*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<OpenHome::Net::Argument*>&) in libohNetCore.a(CpiService.o)
      std::__1::__split_buffer<OpenHome::Net::DvAction, std::__1::allocator<OpenHome::Net::DvAction>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<OpenHome::Net::DvAction>&) in libohNetCore.a(DviService.o)
      ...

The most weird thing is that when I add to the project a dummy cpp class this error goes away.

What Am I missing?

Sorry If the question might be a little bit not accurate.

Aucun commentaire:

Enregistrer un commentaire