Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
Posts: 2
Registered: ‎09-20-2012
My Device: Developer
My Carrier: Developer

C++ Linking Issues

Hi,

 

I'm currently working on porting an existing iOS/Android application and framework over to BB10/Playbook using the NDK. I've got it compiling so far, but I'm runing into issues while linking.

 

They appear to primarily be issues linking against the standard library, but I'm linking in stdc++, and the project is based directly off the RotatingCube example, so I'm assuming it's set up correctly.

 

As can be seen I'm linking against -lbps -lcxa -lsupc++ -lc -lstdc++ -lscreen -lEGL -lfreetype -lpng -lm -lsocket -lGLESv2. Is there anything I'm missing for full C++ support?

 

The list of errors are included below.

 

Has anyone got any suggestions as to what could be causing this?

 

Many thanks,

Jamie

 


 


**** Build of configuration Device-Debug for project ProjectName ****

**** Internal Builder is used for build ****
qcc -o ProjectName <many files>.o -lbps -lcxa -lsupc++ -lc -lstdc++ -lscreen -lEGL -lfreetype -lpng -lm -lsocket -lGLESv2 -V4.6.3,gcc_ntoarmv7le -w1 -g -Wl,-z,relro -Wl,-z,now -L/Applications/bbndk/target_10_0_6_543/qnx6/../target-override/armle-v7/lib -L/Applications/bbndk/target_10_0_6_543/qnx6/../target-override/armle-v7/usr/lib
src/framework/script/lua/loslib.o: In function `os_tmpname':
/Users/aeonflame/Development/company/projectname/game/blackberry/Device-Debug/../../../framework/src/script/lua/loslib.c:60: warning: The 'tmpnam' function is dangerous. Use 'mkstemp' instead.
src/src/world.o: In function `std::string::assign(std::string const&, unsigned int, unsigned int)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:697: undefined reference to `std::_String_base::_Xran() const'
src/src/world.o: In function `std::string::erase(unsigned int, unsigned int)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:909: undefined reference to `std::_String_base::_Xran() const'
src/src/world.o: In function `std::string::_Grow(unsigned int, bool)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:1635: undefined reference to `std::_String_base::_Xlen() const'
src/src/hud.o: In function `QiArray<GuiBox:Smiley Frustratedelection>::redim(int)':
/Users/aeonflame/Development/company/projectname/game/blackberry/../../framework/src/base/qiarray.h:91: undefined reference to `operator delete(void*, void*)'
src/src/decompose.o: In function `void std::_Construct<std::vector<QiVec2, std::allocator<QiVec2> >, std::vector<QiVec2, std::allocator<QiVec2> > >(std::vector<QiVec2, std::allocator<QiVec2> >*, std::vector<QiVec2, std::allocator<QiVec2> > const&)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xmemory:40: undefined reference to `operator delete(void*, void*)'
src/framework/script/qiscript.o: In function `QiArray<ScriptFunc>::redim(int)':
/Users/aeonflame/Development/company/projectname/game/blackberry/../../framework/src/base/qiarray.h:91: undefined reference to `operator delete(void*, void*)'
src/framework/file/qipath.o: In function `QiArray<QiString>::redim(int)':
/Users/aeonflame/Development/company/projectname/game/blackberry/../../framework/src/base/qiarray.h:91: undefined reference to `operator delete(void*, void*)'
src/framework/base/tinyxml/tinyxmlparser.o: In function `__static_initialization_and_destruction_0':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
src/framework/base/tinyxml/tinyxmlparser.o: In function `std::_Locinfo::_Getctype() const':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocinfo:78: undefined reference to `_Getctyptab'
src/framework/base/tinyxml/tinyxmlparser.o: In function `std::locale::id:Smiley Surprisedperator unsigned int()':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:78: undefined reference to `std::locale::id::_Id_cnt'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:78: undefined reference to `std::locale::id::_Id_cnt'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:78: undefined reference to `std::locale::id::_Id_cnt'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:78: undefined reference to `std::locale::id::_Id_cnt'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:78: undefined reference to `std::locale::id::_Id_cnt'
src/framework/base/tinyxml/tinyxmlparser.o:/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:78: more undefined references to `std::locale::id::_Id_cnt' follow
src/framework/base/tinyxml/tinyxmlparser.o: In function `ctype':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:1229: undefined reference to `std::_Locinfo::_Locinfo(char const*)'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:1229: undefined reference to `std::_Locinfo::~_Locinfo()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:1229: undefined reference to `std::_Locinfo::~_Locinfo()'
src/framework/base/tinyxml/tinyxmlparser.o: In function `std::ctype<char> const& std::use_facet<std::ctype<char> >(std::locale const&)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:320: undefined reference to `std::locale::_Getfacet(unsigned int) const'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:342: undefined reference to `std::locale::facet::_Register()'
src/framework/base/tinyxml/tinyxmlparser.o: In function `std::string::append(char const*, unsigned int)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:625: undefined reference to `std::_String_base::_Xlen() const'
src/framework/base/tinyxml/tinyxmlparser.o: In function `std::string::at(unsigned int)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:1186: undefined reference to `std::_String_base::_Xran() const'
src/framework/base/tinyxml/tinyxmlparser.o: In function `std::string::append(unsigned int, char)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:644: undefined reference to `std::_String_base::_Xlen() const'
src/framework/base/tinyxml/tinyxmlparser.o: In function `std::string::append(std::string const&, unsigned int, unsigned int)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:604: undefined reference to `std::_String_base::_Xran() const'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:609: undefined reference to `std::_String_base::_Xlen() const'
src/framework/base/tinyxml/tinyxmlparser.o: In function `std::basic_ios<char, std::char_traits<char> >::clear(std::_Iosb<int>::_Iostate, bool)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/ios:38: undefined reference to `std::ios_base::clear(std::_Iosb<int>::_Iostate, bool)'
src/framework/base/tinyxml/tinyxmlerror.o: In function `__static_initialization_and_destruction_0':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
src/framework/base/tinyxml/tinyxml.o: In function `__static_initialization_and_destruction_0':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
src/framework/base/tinyxml/tinyxml.o: In function `std::num_put<char, std:Smiley Surprisedstreambuf_iterator<char, std::char_traits<char> > > const& std::use_facet<std::num_put<char, std:Smiley Surprisedstreambuf_iterator<char, std::char_traits<char> > > >(std::locale const&)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:320: undefined reference to `std::locale::_Getfacet(unsigned int) const'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:342: undefined reference to `std::locale::facet::_Register()'
src/framework/base/tinyxml/tinyxml.o: In function `std::string::compare(unsigned int, unsigned int, char const*, unsigned int) const':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:1559: undefined reference to `std::_String_base::_Xran() const'
src/framework/base/tinyxml/tinyxml.o: In function `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*, bool)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/ios:127: undefined reference to `std::ios_base::_Init()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/ios:136: undefined reference to `std::ios_base::_Addstd()'
src/framework/base/tinyxml/tinyxml.o: In function `basic_streambuf':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/streambuf:21: undefined reference to `std::_Mutex::_Mutex()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/streambuf:23: undefined reference to `std::_Mutex::~_Mutex()'
src/framework/base/tinyxml/tinyxml.o: In function `~basic_streambuf':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/streambuf:37: undefined reference to `std::_Mutex::~_Mutex()'
src/framework/base/tinyxml/tinyxml.o: In function `std::basic_streambuf<char, std::char_traits<char> >::_Lock()':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/streambuf:158: undefined reference to `std::_Mutex::_Lock()'
src/framework/base/tinyxml/tinyxml.o: In function `std::basic_streambuf<char, std::char_traits<char> >::_Unlock()':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/streambuf:163: undefined reference to `std::_Mutex::_Unlock()'
src/framework/base/tinyxml/tinyxml.o: In function `num_put':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocnum:838: undefined reference to `std::_Locinfo::_Locinfo(char const*)'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocnum:838: undefined reference to `std::_Locinfo::~_Locinfo()'
src/framework/base/tinyxml/tinyxml.o: In function `std::numpunct<char> const& std::use_facet<std::numpunct<char> >(std::locale const&)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:320: undefined reference to `std::locale::_Getfacet(unsigned int) const'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocale:342: undefined reference to `std::locale::facet::_Register()'
src/framework/base/tinyxml/tinyxml.o: In function `numpunct':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocnum:76: undefined reference to `std::_Locinfo::_Locinfo(char const*)'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocnum:76: undefined reference to `std::_Locinfo::~_Locinfo()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xlocnum:76: undefined reference to `std::_Locinfo::~_Locinfo()'
src/framework/base/tinyxml/tinyxml.o: In function `std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::seekoff(long, std::_Iosb<int>::_Seekdir, std::_Iosb<int>::_Openmode)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/sstream:193: undefined reference to `std::_BADOFF'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/sstream:193: undefined reference to `std::_BADOFF'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/sstream:203: undefined reference to `std::_BADOFF'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/sstream:203: undefined reference to `std::_BADOFF'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/sstream:212: undefined reference to `std::_BADOFF'
src/framework/base/tinyxml/tinyxml.o:/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/sstream:212: more undefined references to `std::_BADOFF' follow
src/framework/base/tinyxml/tinyxml.o: In function `fpos':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iosfwd:28: undefined reference to `std::_Fpz'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iosfwd:28: undefined reference to `std::_Fpz'
src/framework/base/tinyxml/tinyxml.o: In function `std::string::insert(unsigned int, unsigned int, char)':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:838: undefined reference to `std::_String_base::_Xran() const'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/xstring:840: undefined reference to `std::_String_base::_Xlen() const'
src/framework/base/qixmlwriter.o: In function `__static_initialization_and_destruction_0':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
src/framework/base/qixmlparser.o: In function `__static_initialization_and_destruction_0':
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
/Applications/bbndk/target_10_0_6_543/qnx6/usr/include/cpp/iostream:45: undefined reference to `std::_Winit::~_Winit()'
src/Box2D/Dynamics/b2World.o: In function `b2World::CreateBody(b2BodyDef const*)':
/Users/aeonflame/Development/company/projectname/game/blackberry/Device-Debug/../../Box2D/Dynamics/b2World.cpp:91: undefined reference to `operator delete(void*, void*)'
src/Box2D/Dynamics/b2Body.o: In function `b2Body::CreateFixture(b2FixtureDef const*)':
/Users/aeonflame/Development/company/projectname/game/blackberry/Device-Debug/../../Box2D/Dynamics/b2Body.cpp:150: undefined reference to `operator delete(void*, void*)'
src/Box2D/Dynamics/Joints/b2Joint.o: In function `b2Joint::Create(b2JointDef const*, b2BlockAllocator*)':
/Users/aeonflame/Development/company/projectname/game/blackberry/Device-Debug/../../Box2D/Dynamics/Joints/b2Joint.cpp:44: undefined reference to `operator delete(void*, void*)'
/Users/aeonflame/Development/company/projectname/game/blackberry/Device-Debug/../../Box2D/Dynamics/Joints/b2Joint.cpp:51: undefined reference to `operator delete(void*, void*)'
/Users/aeonflame/Development/company/projectname/game/blackberry/Device-Debug/../../Box2D/Dynamics/Joints/b2Joint.cpp:58: undefined reference to `operator delete(void*, void*)'
src/Box2D/Dynamics/Joints/b2Joint.o:/Users/aeonflame/Development/company/projectname/game/blackberry/Device-Debug/../../Box2D/Dynamics/Joints/b2Joint.cpp:65: more undefined references to `operator delete(void*, void*)' follow
cc: /Applications/bbndk/host_10_0_6_1/darwin/x86/usr/bin/ntoarm-ld error 1
Build error occurred, build is stopped
Time consumed: 1034 ms.

New Contributor
Posts: 2
Registered: ‎09-20-2012
My Device: Developer
My Carrier: Developer

Re: C++ Linking Issues

For anyone else encountering this problem, it was simply missing -lcpp.