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
)