Using -Objc Flag in XCode Gives Mach-O Linker Errors - c++

I am trying to integrate google AdMobs into my iOS app, but in order to use their SDK I need to use the -ObjC linker flag to load their category methods. Everything works perfectly without the linker, but when I add the -ObjC flag in Xcode under Debug and Release I get a huge list of Mach-O linker errors (below).
I'm using Box2D, which uses both C and C++, so at first I thought I just needed to include the appropriate linker flag, but I couldn't find one that fixed the errors.
I also tried importing the libstdc++.dylib library, which got rid of the original linker errors and instead replaced them with errors claiming I had a ton of duplicate symbols in my CCScrollLayer.
I'm at a loss. Any help at all would be very, very much appreciated.
-Objc Errors:
Undefined symbols for architecture i386:
"std::string::c_str() const", referenced from:
TiXmlElement* createValueElm<int>(char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<float>(char const*, float) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<long long>(char const*, long long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned long>(char const*, unsigned long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned int>(char const*, unsigned int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<char const*>(TiXmlElement*, char const*, char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<int>(TiXmlElement*, char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
...
"std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::str() const", referenced from:
TiXmlElement* createValueElm<int>(char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<float>(char const*, float) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<long long>(char const*, long long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned long>(char const*, unsigned long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned int>(char const*, unsigned int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<char const*>(TiXmlElement*, char const*, char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<int>(TiXmlElement*, char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
...
"std::allocator<char>::allocator()", referenced from:
float stringToValue<float>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
int stringToValue<int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned int stringToValue<unsigned int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned long stringToValue<unsigned long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
long long stringToValue<long long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::allocator<char>::~allocator()", referenced from:
float stringToValue<float>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
int stringToValue<int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned int stringToValue<unsigned int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned long stringToValue<unsigned long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
long long stringToValue<long long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::istream::operator>>(float&)", referenced from:
float stringToValue<float>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::istream::operator>>(int&)", referenced from:
int stringToValue<int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::istream::operator>>(unsigned int&)", referenced from:
unsigned int stringToValue<unsigned int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::istream::operator>>(unsigned long&)", referenced from:
unsigned long stringToValue<unsigned long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::istream::operator>>(long long&)", referenced from:
long long stringToValue<long long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::ostream::operator<<(float)", referenced from:
TiXmlElement* createValueElm<float>(char const*, float) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<float>(TiXmlElement*, char const*, float) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::ostream::operator<<(int)", referenced from:
TiXmlElement* createValueElm<int>(char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<int>(TiXmlElement*, char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::ostream::operator<<(unsigned int)", referenced from:
TiXmlElement* createValueElm<unsigned int>(char const*, unsigned int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::ostream::operator<<(unsigned long)", referenced from:
TiXmlElement* createValueElm<unsigned long>(char const*, unsigned long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::ostream::operator<<(long long)", referenced from:
TiXmlElement* createValueElm<long long>(char const*, long long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
float stringToValue<float>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
int stringToValue<int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned int stringToValue<unsigned int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned long stringToValue<unsigned long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
long long stringToValue<long long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
TiXmlElement* createValueElm<int>(char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<float>(char const*, float) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<long long>(char const*, long long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned long>(char const*, unsigned long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned int>(char const*, unsigned int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<char const*>(TiXmlElement*, char const*, char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<int>(TiXmlElement*, char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
...
"std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::basic_istringstream(std::string const&, std::_Ios_Openmode)", referenced from:
float stringToValue<float>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
int stringToValue<int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned int stringToValue<unsigned int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned long stringToValue<unsigned long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
long long stringToValue<long long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_istringstream()", referenced from:
float stringToValue<float>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
int stringToValue<int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned int stringToValue<unsigned int>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
unsigned long stringToValue<unsigned long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
long long stringToValue<long long>(char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)", referenced from:
TiXmlElement* createValueElm<int>(char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<float>(char const*, float) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<long long>(char const*, long long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned long>(char const*, unsigned long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned int>(char const*, unsigned int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<char const*>(TiXmlElement*, char const*, char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<int>(TiXmlElement*, char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
...
"std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()", referenced from:
TiXmlElement* createValueElm<int>(char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<float>(char const*, float) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<long long>(char const*, long long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned long>(char const*, unsigned long) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
TiXmlElement* createValueElm<unsigned int>(char const*, unsigned int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<char const*>(TiXmlElement*, char const*, char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
void setAttribute<int>(TiXmlElement*, char const*, int) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
...
"std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree_iterator<std::pair<long long const, cpShape*> >::operator--() in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
std::_Rb_tree_iterator<std::pair<long long const, cpBody*> >::operator--() in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree_iterator<std::pair<long long const, cpShape*> >::operator++() in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
std::_Rb_tree_iterator<std::pair<long long const, cpBody*> >::operator++() in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree<long long, std::pair<long long const, cpShape*>, std::_Select1st<std::pair<long long const, cpShape*> >, std::less<long long>, std::allocator<std::pair<long long const, cpShape*> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<long long const, cpShape*> const&) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
std::_Rb_tree<long long, std::pair<long long const, cpBody*>, std::_Select1st<std::pair<long long const, cpBody*> >, std::less<long long>, std::allocator<std::pair<long long const, cpBody*> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<long long const, cpBody*> const&) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
void setAttribute<char const*>(TiXmlElement*, char const*, char const*) in libchipmunk-spacemanager-ios.a(cpSpaceSerializer.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Errors with the libstdc++.dylib:
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.layers_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.currentScreen_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.pagesIndicatorNormalColor_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.pagesIndicatorSelectedColor_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.prevScreen_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.scrollTouch_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.startSwipe_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.state_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.marginOffset_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.delegate_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.minimumTouchLengthToSlide_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.minimumTouchLengthToChangePage_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.showPagesIndicator_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.pagesIndicatorPosition_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.pagesWidthOffset_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_IVAR_$_CCScrollLayer.stealTouches_ in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_CLASS_$_CCScrollLayer in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
duplicate symbol _OBJC_METACLASS_$_CCScrollLayer in:
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Intermediates/ballBounce.build/Debug-iphonesimulator/ballBounce-iOS.build/Objects-normal/i386/CCScrollLayer.o
/Users/Stevenpd/Library/Developer/Xcode/DerivedData/Kobold2D-bhlexwnjvtnneigernvsargfadgb/Build/Products/Debug-iphonesimulator/libcocos2d-extensions-ios.a(CCScrollLayer.o)
ld: 18 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Related

Compiling hello world.cpp in terminal (macOS) [duplicate]

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Compiling a C++ program with GCC
(9 answers)
Closed 3 years ago.
I'm trying to compile a C++ helloWorld in terminal.
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
I cd to the directory containing the code. I manage to compile with the command g++ -o hello c_helloworld.cpp. But when I use the command gcc -o hello c_helloworld.cpp I get the following error.
Undefined symbols for architecture x86_64: "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced
from:
std::__1::ctype const& std::__1::use_facet >(std::__1::locale const&)
in c_helloworld-a3d3b8.o "std::__1::ios_base::getloc() const",
referenced from:
std::__1::basic_ios >::widen(char) const in c_helloworld-a3d3b8.o "std::__1::basic_string,
std::__1::allocator >::__init(unsigned long, char)", referenced
from:
std::__1::basic_string, std::__1::allocator >::basic_string(unsigned long, char) in
c_helloworld-a3d3b8.o "std::__1::basic_string, std::__1::allocator
::~basic_string()", referenced from:
std::__1::ostreambuf_iterator > std::__1::__pad_and_output >(std::__1::ostreambuf_iterator >, char const*, char const*, char const*, std::__1::ios_base&, char) in
c_helloworld-a3d3b8.o "std::__1::basic_ostream >::put(char)", referenced from:
std::__1::basic_ostream >& std::__1::endl
(std::__1::basic_ostream >&) in c_helloworld-a3d3b8.o "std::__1::basic_ostream >::flush()", referenced from:
std::__1::basic_ostream >& std::__1::endl
(std::__1::basic_ostream >&) in c_helloworld-a3d3b8.o "std::__1::basic_ostream
::sentry::sentry(std::__1::basic_ostream >&)", referenced from:
std::__1::basic_ostream >& std::__1::__put_character_sequence
(std::__1::basic_ostream >&, char const*, unsigned long) in c_helloworld-a3d3b8.o
"std::__1::basic_ostream
::sentry::~sentry()", referenced from:
std::__1::basic_ostream >& std::__1::__put_character_sequence
(std::__1::basic_ostream >&, char const*, unsigned long) in c_helloworld-a3d3b8.o "std::__1::cout",
referenced from:
_main in c_helloworld-a3d3b8.o "std::__1::ctype::id", referenced from:
std::__1::ctype const& std::__1::use_facet >(std::__1::locale const&)
in c_helloworld-a3d3b8.o "std::__1::locale::~locale()", referenced
from:
std::__1::basic_ios >::widen(char) const in c_helloworld-a3d3b8.o "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced
from:
std::__1::basic_ostream >& std::__1::__put_character_sequence
(std::__1::basic_ostream >&, char const*, unsigned long) in c_helloworld-a3d3b8.o
"std::__1::ios_base::clear(unsigned int)", referenced from:
std::__1::ios_base::setstate(unsigned int) in c_helloworld-a3d3b8.o "std::terminate()", referenced from:
___clang_call_terminate in c_helloworld-a3d3b8.o "___cxa_begin_catch", referenced from:
std::__1::basic_ostream >& std::__1::__put_character_sequence
(std::__1::basic_ostream >&, char const*, unsigned long) in c_helloworld-a3d3b8.o
___clang_call_terminate in c_helloworld-a3d3b8.o "___cxa_call_unexpected", referenced from:
std::__1::ostreambuf_iterator >::ostreambuf_iterator(std::__1::basic_ostream >&) in c_helloworld-a3d3b8.o
"___cxa_end_catch", referenced from:
std::__1::basic_ostream >& std::__1::__put_character_sequence
(std::__1::basic_ostream >&, char const*, unsigned long) in c_helloworld-a3d3b8.o
"___gxx_personality_v0", referenced from:
std::__1::basic_ostream >& std::__1::__put_character_sequence
(std::__1::basic_ostream >&, char const*, unsigned long) in c_helloworld-a3d3b8.o
std::__1::ostreambuf_iterator > std::__1::__pad_and_output >(std::__1::ostreambuf_iterator >, char const*, char const*, char const*, std::__1::ios_base&, char) in
c_helloworld-a3d3b8.o
std::__1::ostreambuf_iterator >::ostreambuf_iterator(std::__1::basic_ostream >&) in c_helloworld-a3d3b8.o
std::__1::basic_ios >::widen(char) const in c_helloworld-a3d3b8.o
Dwarf Exception Unwind Info (__eh_frame) in c_helloworld-a3d3b8.o ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
gcc is used to compile C programs (by default), g++ is for C++.
So, the behaviour is expected.
By default, gcc links to the standard C library.
If you want to compile C++ programs you can link to the standard C++ library by adding the following option:
gcc -o hello c_helloworld.cpp -lstdc++
PS. I suggest you to search the website before asking a question, there was already an answer for this.
Compiling a C++ program with gcc
Using g++ is easier for compiling .cpp files. Execute the compiled code by running ./outputfile in the directory. So basically that would be running
g++ file.cpp -o file && ./file
in the command line
Edit: My mistake.. gcc can be used here as well, but it's simpler to just use g++

QT Library imported in iOS native sdk

So the plan for this project is to have a QT library that can be used in a native SDK.
We have done a mock library that when imported in a QT App buit into a xcodeproj works without issues.
The library is static, running lipo -info returns x86_64 arm64.
I used the tutorial from https://alediaferia.com/2014/12/18/a-native-ios-app-with-a-qt-third-party-library/ but got stuck. After a bit of digging I got to the step where linking occurs this is the result:
Undefined symbols for architecture arm64:
"_pcre2_match_16", referenced from:
safe_pcre2_match_16(pcre2_real_code_16 const*, unsigned short const*, int, int, int, pcre2_real_match_data_16*, pcre2_real_match_context_16*) in libQt5Core.a(qregularexpression.o)
"_pcre2_match_context_create_16", referenced from:
QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core.a(qregularexpression.o)
"_pcre2_jit_stack_assign_16", referenced from:
QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core.a(qregularexpression.o)
"_pcre2_jit_stack_free_16", referenced from:
QThreadStorage<QPcreJitStackPointer*>::deleteData(void*) in libQt5Core.a(qregularexpression.o)
"_pcre2_get_ovector_pointer_16", referenced from:
QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core.a(qregularexpression.o)
"_pcre2_match_data_free_16", referenced from:
QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core.a(qregularexpression.o)
"_pcre2_config_16", referenced from:
QRegularExpressionPrivate::getPatternInfo() in libQt5Core.a(qregularexpression.o)
"_pcre2_pattern_info_16", referenced from:
QRegularExpressionPrivate::getPatternInfo() in libQt5Core.a(qregularexpression.o)
QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core.a(qregularexpression.o)
"_pcre2_jit_compile_16", referenced from:
QRegularExpressionPrivate::optimizePattern() in libQt5Core.a(qregularexpression.o)
"_pcre2_match_context_free_16", referenced from:
QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core.a(qregularexpression.o)
"_pcre2_compile_16", referenced from:
QRegularExpressionPrivate::compilePattern() in libQt5Core.a(qregularexpression.o)
"_pcre2_code_free_16", referenced from:
QRegularExpressionPrivate::~QRegularExpressionPrivate() in libQt5Core.a(qregularexpression.o)
QRegularExpressionPrivate::compilePattern() in libQt5Core.a(qregularexpression.o)
"_pcre2_jit_stack_create_16", referenced from:
safe_pcre2_match_16(pcre2_real_code_16 const*, unsigned short const*, int, int, int, pcre2_real_match_data_16*, pcre2_real_match_context_16*) in libQt5Core.a(qregularexpression.o)
"_pcre2_match_data_create_from_pattern_16", referenced from:
QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core.a(qregularexpression.o)
"_uncompress", referenced from:
qUncompress(unsigned char const*, int) in libQt5Core.a(qbytearray.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How the project looks:
Does anyone know what is going on?
You're missing the linking to libqtpcre2
Add
-lqtpcre2
into your "OTHER LINKER FLAGS" in xcode's "build settings"

Code compiles in Xcode but not from Command Line

So I have a mini OpenGL project that I am doing in C++ in Xcode. I am using several libraries including the SOIL and GLEW libraries, their respective header files, and the SDL2, OpenGL, and Corefoundation frameworks. The project builds just fine in Xcode with the following compiler options: C++ Language Dialect set to -std=c++11 and C++ Standard Library set to libc++. However, when I try to build this project with clang on the command line, with the following command:
clang++ -stdlib=libc++ -std=c++11
-I/usr/local/include/SOIL/src
-I/usr/local/include/glm/glm
-I/usr/local/include/glew-1.10.0/include/
-framework SDL2
-framework CoreFoundation
-framework OpenGL
-L/usr/local/include/glew-1.10.0/lib/
-L/usr/local/lib
main.cpp euchre.cpp euchre.h (These 3 files are in the same directory)
I get the following errors:
Undefined symbols for architecture x86_64:
"_SOIL_free_image_data", referenced from:
Euchre::MakeObject::LoadTexture(char const*, int) in euchre-d6b330.o
"_SOIL_load_image", referenced from:
Euchre::MakeObject::LoadTexture(char const*, int) in euchre-d6b330.o
"___glewActiveTexture", referenced from:
Euchre::MakeObject::LoadTexture(char const*, int) in euchre-d6b330.o
"___glewAttachShader", referenced from:
Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
"___glewBindBuffer", referenced from:
Euchre::MakeObject::makeAttribute(unsigned int, char const*, unsigned int, unsigned int, int, unsigned int, unsigned char, int, void const*) in euchre-d6b330.o
unsigned int Euchre::MakeObject::makeBufferObject<float>(int, unsigned int, unsigned int, std::__1::vector<float, std::__1::allocator<float> >) in euchre-d6b330.o
unsigned int Euchre::MakeObject::makeBufferObject<unsigned int>(int, unsigned int, unsigned int, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >) in euchre-d6b330.o
"___glewBindVertexArray", referenced from:
_main in main-6799fc.o
"___glewBufferData", referenced from:
unsigned int Euchre::MakeObject::makeBufferObject<float>(int, unsigned int, unsigned int, std::__1::vector<float, std::__1::allocator<float> >) in euchre-d6b330.o
unsigned int Euchre::MakeObject::makeBufferObject<unsigned int>(int, unsigned int, unsigned int, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >) in euchre-d6b330.o
"___glewCompileShader", referenced from:
Euchre::MakeObject::compileShader(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in euchre-d6b330.o
"___glewCreateProgram", referenced from:
Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
"___glewCreateShader", referenced from:
Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
"___glewDeleteBuffers", referenced from:
_main in main-6799fc.o
"___glewDeleteProgram", referenced from:
_main in main-6799fc.o
"___glewDeleteShader", referenced from:
Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
"___glewDeleteVertexArrays", referenced from:
_main in main-6799fc.o
"___glewEnableVertexAttribArray", referenced from:
Euchre::MakeObject::makeAttribute(unsigned int, char const*, unsigned int, unsigned int, int, unsigned int, unsigned char, int, void const*) in euchre-d6b330.o
"___glewGenBuffers", referenced from:
unsigned int Euchre::MakeObject::makeBufferObject<float>(int, unsigned int, unsigned int, std::__1::vector<float, std::__1::allocator<float> >) in euchre-d6b330.o
unsigned int Euchre::MakeObject::makeBufferObject<unsigned int>(int, unsigned int, unsigned int, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >) in euchre-d6b330.o
"___glewGenVertexArrays", referenced from:
Euchre::MakeObject::makeVertexArrayObject(int) in euchre-d6b330.o
"___glewGetAttribLocation", referenced from:
Euchre::MakeObject::makeAttribute(unsigned int, char const*, unsigned int, unsigned int, int, unsigned int, unsigned char, int, void const*) in euchre-d6b330.o
"___glewGetShaderiv", referenced from:
Euchre::MakeObject::compileShader(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in euchre-d6b330.o
"___glewLinkProgram", referenced from:
Euchre::MakeObject::LoadShaders(char const*, char const*) in euchre-d6b330.o
"___glewShaderSource", referenced from:
Euchre::MakeObject::compileShader(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in euchre-d6b330.o
"___glewUseProgram", referenced from:
_main in main-6799fc.o
"___glewVertexAttribPointer", referenced from:
Euchre::MakeObject::makeAttribute(unsigned int, char const*, unsigned int, unsigned int, int, unsigned int, unsigned char, int, void const*) in euchre-d6b330.o
"_glewExperimental", referenced from:
_main in main-6799fc.o
"_glewInit", referenced from:
_main in main-6799fc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What I don't understand is how I am compiling with the same settings as on Xcode, but in terminal, I can't get this to work.

Linker error in Xcode 5.1 with cocos2d-x 3 beta 2

oday i tried to compile in Xcode 5.1 my sample app and i got linker error can someone tell me why is it happening ?
Ld /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Intermediates/Slot321.build/Debug-iphoneos/Slot321\ iOS.build/Objects-normal/arm64/Slot321\ iOS normal arm64
cd /Users/mmmssss/Documents/xcode5_projects/Slot321/Slot321/proj.ios_mac
export IPHONEOS_DEPLOYMENT_TARGET=5.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos -F/Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos -filelist /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Intermediates/Slot321.build/Debug-iphoneos/Slot321\ iOS.build/Objects-normal/arm64/Slot321\ iOS.LinkFileList -dead_strip -stdlib=libc++ -fobjc-link-runtime -miphoneos-version-min=5.0 /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libbox2d\ iOS.a /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libchipmunk\ iOS.a /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libcocos2dx\ iOS.a /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libcocos2dx-extensions\ iOS.a /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libCocosDenshion\ iOS.a -framework CoreMotion -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -lz -framework QuartzCore -framework OpenAL -framework AVFoundation -framework AudioToolbox -Xlinker -dependency_info -Xlinker /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Intermediates/Slot321.build/Debug-iphoneos/Slot321\ iOS.build/Objects-normal/arm64/Slot321\ iOS_dependency_info.dat -o /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Intermediates/Slot321.build/Debug-iphoneos/Slot321\ iOS.build/Objects-normal/arm64/Slot321\ iOS
Undefined symbols for architecture arm64:
"_WebPGetFeaturesInternal", referenced from:
WebPGetFeatures(unsigned char const*, unsigned long, WebPBitstreamFeatures*) in libcocos2dx iOS.a(CCImage.o)
"_WebPDecode", referenced from:
cocos2d::Image::initWithWebpData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_TIFFGetField", referenced from:
cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_TIFFClose", referenced from:
cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_jpeg_CreateDecompress", referenced from:
cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_jpeg_read_header", referenced from:
cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_TIFFReadRGBAImageOriented", referenced from:
cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_jpeg_start_decompress", referenced from:
cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_jpeg_read_scanlines", referenced from:
cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_jpeg_destroy_decompress", referenced from:
cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_WebPInitDecoderConfigInternal", referenced from:
WebPInitDecoderConfig(WebPDecoderConfig*) in libcocos2dx iOS.a(CCImage.o)
"_png_create_info_struct", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_read_info", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_jpeg_std_error", referenced from:
cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_get_image_width", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_set_packing", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_create_read_struct", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_get_image_height", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_set_palette_to_rgb", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_sig_cmp", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_get_valid", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_read_end", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_set_longjmp_fn", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"__TIFFfree", referenced from:
cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_FT_Done_FreeType", referenced from:
cocos2d::FontFreeType::shutdownFreeType() in libcocos2dx iOS.a(CCFontFreeType.o)
"_png_set_tRNS_to_alpha", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_get_rowbytes", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_read_update_info", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_jpeg_mem_src", referenced from:
cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_set_expand_gray_1_2_4_to_8", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"__TIFFmalloc", referenced from:
cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_set_strip_16", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_get_io_ptr", referenced from:
cocos2d::(anonymous namespace)::pngReadCallback(png_struct_def*, unsigned char*, unsigned long) in libcocos2dx iOS.a(CCImage.o)
"_png_set_read_fn", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_error", referenced from:
cocos2d::(anonymous namespace)::pngReadCallback(png_struct_def*, unsigned char*, unsigned long) in libcocos2dx iOS.a(CCImage.o)
"_png_get_bit_depth", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_get_color_type", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_destroy_read_struct", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_TIFFClientOpen", referenced from:
cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
"_png_read_image", referenced from:
cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The last release of cocos2d-x (Cocos2d-x v3.0 rc0) fixes this issue. The new version adds arm64 support for XCode 5.1.
You should upgrade your project downloading the new version from here.
More information can be found on the official changelog.
Go your project settings, Build Settings, Architectures, and select "Other...". Modify the string to read $(ARCHS_STANDARD_32_BIT).
Are those external libraries also compiled for arm64? Because if not, then you must disable it in Xcode settings e.g. making it {ARCHS_STANDARD_32BIT}
Change your libraries version.
In my case, I change UIKit.framework, CoreMotion.framework and OpenGLES.framework libraries for iOS 7.1 version. (at Build Phases > LinkBinary With Libraries)
Delete red colored libraries and add new version of it.

argument unused during compilation: '-stdlib'

My project 100% working on IOS 6.1 but as I change I got following issue
clang: warning: argument unused during compilation: '-stdlib'
Undefined symbols for architecture armv7:
"std::cerr", referenced from:
ImageCodec::unregisterCodec(ImageCodec*) in ocrkit-bin.o
colorspace_convert(Image&, int, int, unsigned char) in ocrkit-bin.o
colorspace_by_name(Image&, std::string const&, unsigned char) in ocrkit-bin.o
flipX(Image&) in ocrkit-bin.o
rot90(Image&, int) in ocrkit-bin.o
exif_rotate(Image&, unsigned int) in ocrkit-bin.o
BMPCodec::writeImage(std::ostream*, Image&, int, std::string const&) in ocrkit-bin.o
...
"std::string::operator+=(std::string const&)", referenced from:
Args::str() in ocrkit-bin.o
"std::__throw_length_error(char const*)", referenced from:
std::vector<PDFObject*, std::allocator<PDFObject*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<PDFObject**, std::vector<PDFObject*, std::allocator<PDFObject*> > >, PDFObject* const&) in ocrkit-bin.o
std::vector<unsigned char, std::allocator<unsigned char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&) in ocrkit-bin.o
std::vector<unsigned char, std::allocator<unsigned char> >::_M_insert_aux(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char const&) in ocrkit-bin.o
l4495 in ocrkit-bin.o
l4497 in ocrkit-bin.o
l4499 in ocrkit-bin.o
l4501 in ocrkit-bin.o
...
"std::string::clear()", referenced from:
PDFContentStream::writeStreamImpl(std::ostream&) in ocrkit-bin.o
"std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)", referenced from:
PDFXObject::writeStreamImpl(std::ostream&) in ocrkit-bin.o
PDFContentStream::writeStreamImpl(std::ostream&) in ocrkit-bin.o
"std::ostream::operator<<(double)", referenced from:
quantize::quantize(double, int) in ocrkit-bin.o
"std::ostream::operator<<(unsigned long long)", referenced from:
PDFNumber::writeImpl(std::ostream&) in ocrkit-bin.o
PDFTrailer::write(std::ostream&) in ocrkit-bin.o
"std::_List_node_base::hook(std::_List_node_base*)", referenced from:
std::list<ImageCodec::loader_ref, std::allocator<ImageCodec::loader_ref> >::_M_insert(std::_List_iterator<ImageCodec::loader_ref>, ImageCodec::loader_ref const&) in ocrkit-bin.o
std::list<PDFObject*, std::allocator<PDFObject*> >::_M_insert(std::_List_iterator<PDFObject*>, PDFObject* const&) in ocrkit-bin.o
std::list<PDFXObject*, std::allocator<PDFXObject*> >::_M_insert(std::_List_iterator<PDFXObject*>, PDFXObject* const&) in ocrkit-bin.o
std::list<PDFPage*, std::allocator<PDFPage*> >::_M_insert(std::_List_iterator<PDFPage*>, PDFPage* const&) in ocrkit-bin.o
"std::basic_ofstream<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)", referenced from:
PrintLines(void*, char const*) in ocrkit-bin.o
"std::string::operator[](unsigned long)", referenced from:
PNG2Codec::readImage(std::istream*, Image&, std::string const&) in ocrkit-bin.o
quantize::quantize(double, int) in ocrkit-bin.o
"std::basic_ios<char, std::char_traits<char> >::fill(char)", referenced from:
PDFXref::write(std::ostream&) in ocrkit-bin.o
"std::string::operator=(std::string const&)", referenced from:
quantize::quantize(double, int) in ocrkit-bin.o
PDFXObject::writeStreamTagsImpl(std::ostream&) in ocrkit-bin.o
Args::str() in ocrkit-bin.o
"std::ostream::tellp()", referenced from:
PDFXref::write(std::ostream&) in ocrkit-bin.o
PDFStream::writeImpl(std::ostream&) in ocrkit-bin.o
PDFObject::write(std::ostream&) in ocrkit-bin.o
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char)", referenced from:
PDFXref::write(std::ostream&) in ocrkit-bin.o
PNG2Codec::readImage(std::istream*, Image&, std::string const&) in ocrkit-bin.o
"std::_Rb_tree_increment(std::_Rb_tree_node_base const*)", referenced from:
PDFPage::writeImpl(std::ostream&) in ocrkit-bin.o
Args::str() in ocrkit-bin.o
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, unsigned char)", referenced from:
l022 in ocrkit-bin.o
"std::string::append(char const*)", referenced from:
_ocrForImage in ocrkit-bin.o
I have using these -ObjC -lxml2 -all_load -lstdc++ all linker flag and its 100% working on IOS 6.1
What is the issue with IOS 7.0 compiler
It is possible that your project uses some other frameworks or embedded projects that have been compiled with gcc, and switching your project to 7.0 has started building using llvm.
You can force the project to use gcc's standard library in the Apple LLVM 5.0 - C++ section of your target's build settings
The errors indicate a C++ standard library is not linked, I think for llvm you need to pass
-stdlib=libc++
rather then
-lstdc++
(which is used by gcc?)
Not entirely sure though, I don't mix C++ with Objective C myself.
You probably used GCC i.s.o. LLVM prior to iOS7, so the compiler (possible unintended) changed by updating your project.