Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems building ohNet on IOS
18-03-2014, 04:21 AM (This post was last modified: 18-03-2014 07:50 AM by pz003.)
Post: #1
Problems building ohNet on IOS
code:
InitialisationParams* aParams = InitialisationParams::Create();
UpnpLibrary::Initialise(aParams);
std::vector<NetworkAdapter*>* subnetList = UpnpLibrary::CreateSubnetList();
TIpAddress subnet = (*subnetList)[0]->Subnet();
UpnpLibrary::DestroySubnetList(subnetList); //*+++++++*//
UpnpLibrary::StartCp(subnet);

1 Error:
Undefined symbols for architecture i386:
"OpenHome::Net::UpnpLibrary::DestroySubnetList(std::__1::vector<OpenHome::NetworkAdapter*, std::__1::allocator<OpenHome::NetworkAdapter*> >*)", referenced from:
CMyOhNet::StartCp() in MyOhNet.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

CreateSubnetList is ok, but DestroySubnetList can't be found.

if I removed the libohNetCore.a from Linked frameworks and libraries, there are 8 errors :

Undefined symbols for architecture i386:
"OpenHome::Net::UpnpLibrary::Initialise(OpenHome::Net::InitialisationParams*)", referenced from:
CMyOhNet::StartCp() in MyOhNet.o
"OpenHome::Net::UpnpLibrary::CreateSubnetList()", referenced from:
CMyOhNet::StartCp() in MyOhNet.o
"OpenHome::Net::UpnpLibrary::DestroySubnetList(std::__1::vector<OpenHome::NetworkAdapter*, std::__1::allocator<OpenHome::NetworkAdapter*> >*)", referenced from:
CMyOhNet::StartCp() in MyOhNet.o
"OpenHome::Net::UpnpLibrary::Close()", referenced from:
CMyOhNet::Close() in MyOhNet.o
"OpenHome::Net::UpnpLibrary::StartCp(unsigned int)", referenced from:
CMyOhNet::StartCp() in MyOhNet.o
"OpenHome::Net::InitialisationParams::Create()", referenced from:
CMyOhNet::StartCp() in MyOhNet.o
"OpenHome::Net::CpDeviceListCppUpnpAll::CpDeviceListCppUpnpAll(OpenHome::Net::Fun​ctorCpDeviceCpp, OpenHome::Net::FunctorCpDeviceCpp)", referenced from:
CMyOhNet::StartCp() in MyOhNet.o
"OpenHome::NetworkAdapter::Subnet() const", referenced from:
CMyOhNet::StartCp() in MyOhNet.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The lib file is ohNet-1.0.1074-iOs-x86-Debug.tar.gz.

Hope someone's reply, thank you!
Find all posts by this user
18-03-2014, 06:01 AM
Post: #2
RE: Problems building ohNet on IOS
My Xcode version is 5A3005, iPhone Retina(3.5-inch)
Find all posts by this user
18-03-2014, 05:09 PM
Post: #3
RE: Problems building ohNet on IOS
You definitely need to link to libohNetCore.a. UpnpLibrary::DestroySubnetList() should be included in this library so I'm puzzled by the linker error in your first build.

Could you try building the code yourself to see if that helps? You could do this (from the command line, in the ohNet directory) using
Code:
make iOs-x86=1 nocpp11=yes ohNetCore
Find all posts by this user
19-03-2014, 02:56 AM
Post: #4
RE: Problems building ohNet on IOS
I have solved the problem:

Using the libstdc++.dylib caused these link errors, so the right way is to set the c++ standard Library as libstdC++(GNU C++ standard library) .

thank you

(18-03-2014 05:09 PM)simonc Wrote:  You definitely need to link to libohNetCore.a. UpnpLibrary::DestroySubnetList() should be included in this library so I'm puzzled by the linker error in your first build.

Could you try building the code yourself to see if that helps? You could do this (from the command line, in the ohNet directory) using
Code:
make iOs-x86=1 nocpp11=yes ohNetCore
Find all posts by this user
12-05-2014, 04:04 PM
Post: #5
RE: Problems building ohNet on IOS
Hi pz003, did you have to build ohNet yourself?
In my case setting the c++ stlid doesn't seem to work
Find all posts by this user
16-05-2014, 02:10 AM
Post: #6
RE: Problems building ohNet on IOS
yes, I have built ohnet on ios.
(12-05-2014 04:04 PM)rpe Wrote:  Hi pz003, did you have to build ohNet yourself?
In my case setting the c++ stlid doesn't seem to work
Find all posts by this user


Forum Jump: