Apple Mach-O Linker Error with upnpx library

362 views Asked by At

I am having a small problem when using the upnpx library.

I have downloaded the library and opened the upnpdemo workspace. I created in the same workspace a new project to try to create a simple app with this library. I set the parameters like a demo project, but XCode returns 21 errors:

Apple Mach-O Linker Error

Undefined symbols for architecture i386:
"std::string::find(char const*, unsigned long) const", referenced from:
2

There are 2 answers

0
King Ying On

If you build upnpx.a with

**C++ Language Dialect** GNU++11[-std=gnu++11]
**C++ Standard Library** libc++ (LLVM C++ standard library with C++11 support)

In your project you must iOS Deployment Target 7.0 or above

If you get upnpx.a from web, you can try to lower the Deployment target, 6.

And DO NOT FORGET

**Other Linker Flags**: -lstdc++
1
neilco On

In your new project's build settings, set the C++ Language Dialect and C++ Standard Library to Compiler Default for both of them.