ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Hardyn's profile - activity

2020-08-13 08:25:24 -0500 received badge  Self-Learner (source)
2020-08-13 08:25:24 -0500 received badge  Teacher (source)
2020-08-13 08:24:35 -0500 received badge  Famous Question (source)
2019-12-08 03:46:50 -0500 received badge  Notable Question (source)
2019-10-10 10:22:40 -0500 received badge  Popular Question (source)
2019-09-30 11:14:02 -0500 answered a question ROS Serial Melodic, mbed tutorial has broken link

It seems the the link is generated automatically. I have uploaded the project to my own mbed account. Follow the setup

2019-09-09 02:11:15 -0500 marked best answer Linking problem Melodic, compiling multiple .cpp files into single

I am having trouble constructing a node that has several C/CPP files that should be linked into a single. I have googled around for about 1/2 day and I think I have the CMakeLists.txt file correct (obviously I don't).

The files in question build and link correctly outside of ROS (cpp -o SolTrack Soltrack.c Soltrack_RiseSet.c testfn.c -lm), which mean there is something I am missing about the linking options in the CMake file.

The error I am seeing, is below. Excerpts from the CMake file are further below (I cannot attach a file yet).


solar_track.cpp:(.text+0x2d8): undefined reference to SolTrack_RiseSet(Time, Location, Position, RiseSet, double, int, int)
solar_track.cpp:(.text+0x342): undefined reference to `SolTrack(Time, Location, Position*, int, int, int, int)'


find_package(
catkin REQUIRED COMPONENTS
roscpp
std_msgs
${PROJECT_NAME}
)

catkin_package(
INCLUDE_DIRS include
'# LIBRARIES solar_track
CATKIN_DEPENDS roscpp std_msgs
'# DEPENDS system_lib
)

include_directories(
include
${catkin_INCLUDE_DIRS}
)

add_executable(
${PROJECT_NAME}_node
src/SolTrack.c
src/SolTrack_RiseSet.c
src/solar_track.cpp
)

target_link_libraries(
${PROJECT_NAME}_node
${catkin_LIBRARIES}
m #math library
)

2019-09-08 01:18:24 -0500 answered a question Linking problem Melodic, compiling multiple .cpp files into single

So the problem was that I was using a classic C "library", which was upsetting the C++ compiler. After changing my sear

2019-09-08 01:18:24 -0500 received badge  Rapid Responder (source)
2019-09-08 00:49:16 -0500 asked a question Linking problem Melodic, compiling multiple .cpp files into single

Linking problem Melodic, compiling multiple .cpp files into single I am having trouble constructing a node that has seve