Overview
Features
Download
Documentation
Community
Add-Ons & Services

Linking problems with POCO and cross-compiling

Please post support and help requests here.

Linking problems with POCO and cross-compiling

Postby danjal » 11 Jun 2014, 19:13

We have a library: A that does some work with Poco::Net:IPAddress. This compiles fine.
We then have a executable that uses our library: A.
When compiling the executable we these errors:
...A.so: undefined reference to `Poco::Net::IPAddress::~IPAddress()'
...A.so: undefined reference to `Poco::Net::IPAddress::IPAddress(std::string const&)'
...A.so: undefined reference to `Poco::Net::IPAddress::toString() const'

Our executable is setup to use both libPocoNet and LibA:

Code: Select all
cmake_minimum_required(VERSION 2.8)

add_definitions("-std=c++11")

set(CMAKE_TOOLCHAIN_FILE /home/armsdk/projects/Toolchain-TX28.cmake)

project(HalloWorld)

add_executable(HalloWorld main.cpp)

include_directories(.../poco/install/include
...
../A/include)

...
add_library(PocoFoundation SHARED IMPORTED)
set_target_properties(PocoFoundation PROPERTIES IMPORTED_LOCATION ".../lib/libPocoFoundation.so")
add_library(PocoNet SHARED IMPORTED)
set_target_properties(PocoNet PROPERTIES IMPORTED_LOCATION ".../lib/libPocoNet.so")

add_library(A SHARED IMPORTED)
set_target_properties(A PROPERTIES IMPORTED_LOCATION ".../lib/libA.so")
...

target_link_libraries(HalloWorld
...
 PocoFoundation
 PocoNet
 A
...
 )

install(TARGETS HalloWorld RUNTIME DESTINATION bin)

What could be wrong???
danjal
 
Posts: 2
Joined: 30 Sep 2013, 13:33

Re: Linking problems with POCO and cross-compiling

Postby danjal » 12 Jun 2014, 17:13

I solved it.

It was the ordering in target_link_libraries.
Changed from:
Code: Select all
target_link_libraries(HalloWorld
 PocoFoundation
 PocoNet
 A
)

To:
Code: Select all
target_link_libraries(HalloWorld
 A
 PocoFoundation
 PocoNet
)
danjal
 
Posts: 2
Joined: 30 Sep 2013, 13:33


Return to Support

Who is online

Users browsing this forum: No registered users and 5 guests

cron