Skip to content
Snippets Groups Projects
Commit a8f69448 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

strange linking bug fixed

parent ebfc3596
No related branches found
No related tags found
2 merge requests!14After cmake and const refactor,!13Resolve "Adapt to core cmake refactor"
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(wolf_ros_node) project(wolf_ros_node)
## Compile as C++11, supported in ROS Kinetic and newer ## Compile as C++14
add_compile_options(-std=c++14) add_compile_options(-std=c++14)
# -fPIC and -rdynamic ensure unique singleton instance across shared libraries (for factories) see: https://stackoverflow.com/a/8626922
SET(CMAKE_CXX_FLAGS "-fPIC -rdynamic")
find_package(catkin REQUIRED COMPONENTS find_package(catkin REQUIRED COMPONENTS
roslib roslib
...@@ -38,40 +40,31 @@ include_directories( ...@@ -38,40 +40,31 @@ include_directories(
${catkin_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}
) )
add_executable(${PROJECT_NAME} src/node.cpp) add_executable(${PROJECT_NAME} src/node.cpp)
add_library(subscriber_${PROJECT_NAME} add_library(subscriber_${PROJECT_NAME}
src/subscriber_diffdrive.cpp src/subscriber_diffdrive.cpp
src/subscriber_odom2d.cpp) src/subscriber_odom2d.cpp)
add_library(publisher_${PROJECT_NAME} add_library(publisher_${PROJECT_NAME}
src/publisher_graph.cpp src/publisher_graph.cpp
src/publisher_pose.cpp src/publisher_pose.cpp
src/publisher_trajectory.cpp src/publisher_trajectory.cpp
src/publisher_state_block.cpp src/publisher_state_block.cpp
src/publisher_tf.cpp) src/publisher_tf.cpp)
## Specify libraries to link a library or executable target against ## Specify libraries to link a library or executable target against
target_link_libraries(subscriber_${PROJECT_NAME} target_link_libraries(subscriber_${PROJECT_NAME}
${catkin_LIBRARIES} ${catkin_LIBRARIES}
ceres
wolfcore wolfcore
yaml-cpp
dl
) )
target_link_libraries(publisher_${PROJECT_NAME} target_link_libraries(publisher_${PROJECT_NAME}
${catkin_LIBRARIES} ${catkin_LIBRARIES}
ceres
wolfcore wolfcore
yaml-cpp
dl
) )
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES} ${catkin_LIBRARIES}
ceres
wolfcore wolfcore
yaml-cpp
dl
) )
\ No newline at end of file
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
#include "publisher.h" #include "publisher.h"
using namespace wolf; using namespace wolf;
using namespace std;
class WolfRosNode class WolfRosNode
{ {
......
...@@ -84,12 +84,7 @@ WolfRosNode::WolfRosNode() ...@@ -84,12 +84,7 @@ WolfRosNode::WolfRosNode()
WOLF_TRACE("Loading publisher " + type + " via " + lib_publisher); WOLF_TRACE("Loading publisher " + type + " via " + lib_publisher);
auto l = std::make_shared<LoaderRaw>(lib_publisher); auto l = std::make_shared<LoaderRaw>(lib_publisher);
FactoryPublisher::printCallbacks();
FactoryPublisher::printAddress();
l->load(); l->load();
FactoryPublisher::printCallbacks();
FactoryPublisher::printAddress();
//loaders_.push_back(l); //loaders_.push_back(l);
WOLF_INFO("Pub: ", type, " name: ", name); WOLF_INFO("Pub: ", type, " name: ", name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment