Overview
Features
Download
Documentation
Community
Add-Ons & Services

Undefined reference to many symbols

Please post support and help requests here.

Undefined reference to many symbols

Postby armdev » 08 Dec 2013, 22:01

Hello,

I am getting several "undefined reference to " from the linker (g++ 4.7.x) when cross-compiling a simple for ARM. Do you have any idea why the following symbols are defined? The version of POCO I successfully compiled for ARM is 1.4.6-p2, which includes libPocoNet.a :

This is the command:

../../arm/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -o myhttp_client.o -L../../arm/poco/lib -lrt -lpthread ../../arm/poco/lib/libPocoFoundation.a ../../arm/poco/lib/libPocoUtil.a ../../arm/poco/lib/libPocoData.a ../../arm/poco/lib/libPocoXML.a ../../arm/poco/lib/libPocoCrypto.a ../../arm/poco/lib/libPocoNet.a ../../arm/poco/lib/libPocoNetSSL.a -s

Linker errors:

../../arm/poco/lib/libPocoNet.a(HTTPResponse.o): In function `Poco::Net::HTTPResponse::setDate(Poco::Timestamp const&)':
HTTPResponse.cpp:(.text+0x9b4): undefined reference to `Poco::DateTimeFormatter::append(std::string&, Poco::DateTime const&, std::string const&, int)'
HTTPResponse.cpp:(.text+0xa68): undefined reference to `Poco::DateTimeFormat::HTTP_FORMAT'
../../arm/poco/lib/libPocoNet.a(HTTPResponse.o): In function `Poco::Net::HTTPResponse::getDate() const':
HTTPResponse.cpp:(.text+0xaa0): undefined reference to `Poco::DateTimeParser::parse(std::string const&, int&)'
../../arm/poco/lib/libPocoNet.a(HTTPBasicCredentials.o): In function `Poco::Net::HTTPBasicCredentials::parseAuthInfo(std::string const&)':
HTTPBasicCredentials.cpp:(.text+0x25c): undefined reference to `Poco::Base64Decoder::Base64Decoder(std::istream&)'
HTTPBasicCredentials.cpp:(.text+0x370): undefined reference to `Poco::Base64Decoder::~Base64Decoder()'
HTTPBasicCredentials.cpp:(.text+0x4c0): undefined reference to `Poco::Base64Decoder::~Base64Decoder()'
../../arm/poco/lib/libPocoNet.a(HTTPCookie.o): In function `Poco::Net::HTTPCookie::toString() const':
HTTPCookie.cpp:(.text+0x538): undefined reference to `Poco::DateTimeFormatter::append(std::string&, Poco::DateTime const&, std::string const&, int)'
HTTPCookie.cpp:(.text+0x7d8): undefined reference to `Poco::DateTimeFormat::HTTP_FORMAT'
../../arm/poco/lib/libPocoNet.a(HTTPCookie.o): In function `Poco::Net::HTTPCookie::HTTPCookie(Poco::Net::NameValueCollection const&)':
HTTPCookie.cpp:(.text+0x9b0): undefined reference to `Poco::DateTimeParser::parse(std::string const&, int&)'
../../arm/poco/lib/libPocoNet.a(HTTPFixedLengthStream.o): In function `Poco::Net::HTTPFixedLengthInputStream::operator new(unsigned int)':
HTTPFixedLengthStream.cpp:(.text+0x764): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPFixedLengthStream.o): In function `Poco::Net::HTTPFixedLengthInputStream::operator delete(void*)':
HTTPFixedLengthStream.cpp:(.text+0x774): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPFixedLengthStream.o): In function `Poco::Net::HTTPFixedLengthOutputStream::operator new(unsigned int)':
HTTPFixedLengthStream.cpp:(.text+0x960): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPFixedLengthStream.o): In function `Poco::Net::HTTPFixedLengthOutputStream::operator delete(void*)':
HTTPFixedLengthStream.cpp:(.text+0x970): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPFixedLengthStream.o): In function `_GLOBAL__sub_I__ZN4Poco3Net24HTTPFixedLengthStreamBufC2ERNS0_11HTTPSessionExSt13_Ios_Openmode':
HTTPFixedLengthStream.cpp:(.text.startup+0x20): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPFixedLengthStream.cpp:(.text.startup+0x48): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPFixedLengthStream.cpp:(.text.startup+0x64): undefined reference to `Poco::MemoryPool::~MemoryPool()'
../../arm/poco/lib/libPocoNet.a(HTTPHeaderStream.o): In function `Poco::Net::HTTPHeaderInputStream::operator new(unsigned int)':
HTTPHeaderStream.cpp:(.text+0x714): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPHeaderStream.o): In function `Poco::Net::HTTPHeaderInputStream::operator delete(void*)':
HTTPHeaderStream.cpp:(.text+0x724): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPHeaderStream.o): In function `Poco::Net::HTTPHeaderOutputStream::operator new(unsigned int)':
HTTPHeaderStream.cpp:(.text+0x8e4): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPHeaderStream.o): In function `Poco::Net::HTTPHeaderOutputStream::operator delete(void*)':
HTTPHeaderStream.cpp:(.text+0x8f4): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPHeaderStream.o): In function `_GLOBAL__sub_I__ZN4Poco3Net19HTTPHeaderStreamBufC2ERNS0_11HTTPSessionESt13_Ios_Openmode':
HTTPHeaderStream.cpp:(.text.startup+0x24): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPHeaderStream.cpp:(.text.startup+0x4c): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPHeaderStream.cpp:(.text.startup+0x68): undefined reference to `Poco::MemoryPool::~MemoryPool()'
../../arm/poco/lib/libPocoNet.a(HTTPBufferAllocator.o): In function `Poco::Net::HTTPBufferAllocator::allocate(int)':
HTTPBufferAllocator.cpp:(.text+0x4): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPBufferAllocator.o): In function `Poco::Net::HTTPBufferAllocator::deallocate(char*, int)':
HTTPBufferAllocator.cpp:(.text+0x14): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPBufferAllocator.o): In function `_GLOBAL__sub_I__ZN4Poco3Net19HTTPBufferAllocator5_poolE':
HTTPBufferAllocator.cpp:(.text.startup+0x18): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPBufferAllocator.cpp:(.text.startup+0x34): undefined reference to `Poco::MemoryPool::~MemoryPool()'
../../arm/poco/lib/libPocoNet.a(HTTPStream.o): In function `Poco::Net::HTTPInputStream::operator new(unsigned int)':
HTTPStream.cpp:(.text+0x5e4): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPStream.o): In function `Poco::Net::HTTPInputStream::operator delete(void*)':
HTTPStream.cpp:(.text+0x5f4): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPStream.o): In function `Poco::Net::HTTPOutputStream::operator new(unsigned int)':
HTTPStream.cpp:(.text+0x7b4): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPStream.o): In function `Poco::Net::HTTPOutputStream::operator delete(void*)':
HTTPStream.cpp:(.text+0x7c4): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPStream.o): In function `_GLOBAL__sub_I__ZN4Poco3Net13HTTPStreamBufC2ERNS0_11HTTPSessionESt13_Ios_Openmode':
HTTPStream.cpp:(.text.startup+0x20): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPStream.cpp:(.text.startup+0x48): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPStream.cpp:(.text.startup+0x64): undefined reference to `Poco::MemoryPool::~MemoryPool()'
../../arm/poco/lib/libPocoNet.a(HTTPChunkedStream.o): In function `Poco::Net::HTTPChunkedInputStream::operator new(unsigned int)':
HTTPChunkedStream.cpp:(.text+0x9e4): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPChunkedStream.o): In function `Poco::Net::HTTPChunkedInputStream::operator delete(void*)':
HTTPChunkedStream.cpp:(.text+0x9f4): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPChunkedStream.o): In function `Poco::Net::HTTPChunkedOutputStream::operator new(unsigned int)':
HTTPChunkedStream.cpp:(.text+0xbb4): undefined reference to `Poco::MemoryPool::get()'
../../arm/poco/lib/libPocoNet.a(HTTPChunkedStream.o): In function `Poco::Net::HTTPChunkedOutputStream::operator delete(void*)':
HTTPChunkedStream.cpp:(.text+0xbc4): undefined reference to `Poco::MemoryPool::release(void*)'
../../arm/poco/lib/libPocoNet.a(HTTPChunkedStream.o): In function `_GLOBAL__sub_I__ZN4Poco3Net20HTTPChunkedStreamBufC2ERNS0_11HTTPSessionESt13_Ios_Openmode':
HTTPChunkedStream.cpp:(.text.startup+0x24): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPChunkedStream.cpp:(.text.startup+0x4c): undefined reference to `Poco::MemoryPool::MemoryPool(unsigned int, int, int)'
HTTPChunkedStream.cpp:(.text.startup+0x68): undefined reference to `Poco::MemoryPool::~MemoryPool()'
../../arm/poco/lib/libPocoNet.a(HTTPClientSession.o): In function `Poco::Net::HTTPClientSession::sendRequest(Poco::Net::HTTPRequest&)':
HTTPClientSession.cpp:(.text+0xc20): undefined reference to `Poco::CountingOutputStream::CountingOutputStream()'
HTTPClientSession.cpp:(.text+0xd14): undefined reference to `Poco::CountingOutputStream::~CountingOutputStream()'
HTTPClientSession.cpp:(.text+0xd54): undefined reference to `Poco::CountingOutputStream::CountingOutputStream()'
HTTPClientSession.cpp:(.text+0x1060): undefined reference to `Poco::CountingOutputStream::~CountingOutputStream()'
HTTPClientSession.cpp:(.text+0x10bc): undefined reference to `Poco::CountingOutputStream::~CountingOutputStream()'
collect2: error: ld returned 1 exit status
armdev
 
Posts: 1
Joined: 08 Dec 2013, 21:53

Re: Undefined reference to many symbols

Postby throstur62 » 09 Dec 2013, 13:51

I have a very similar problem porting POCO 1.4.6p2 to ARM. Se description at viewtopic.php?f=12&t=6048
Try to link to the POCO debug libraries instead, and se if that links. Note those are the POCO libraries ending with a "d.so" instead of just ".so".
throstur62
 
Posts: 11
Joined: 22 Nov 2012, 18:44

Re: Undefined reference to many symbols

Postby guenter » 09 Dec 2013, 17:54

When linking statically, the order of libraries on the command line is significant. You'll have to specify them in the correct order, considering dependencies. Correct order is: -lPocoNetSSL_OpenSSL -lPocoNet -lPocoDataSQLite -lPocoData -lPocoCrypto -lPocoUtil -lPocoXML -lPocoFoundation
guenter
 
Posts: 1129
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron