Dependancy Problem Packaging c library
Hey there. Unfortunately I have another problem: With the dependencies in the Cmakelist:
cmake_minimum_required(VERSION 2.8)
project(grampc)
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_runtime rosbag)
add_service_files(FILES grampc_IO.srv)
generate_messages(DEPENDENCIES std_msgs)
catkin_package(
CATKIN_DEPENDS roscpp rospy std_msgs message_runtime message_generation rosbag
)
include_directories(
include ${catkin_INCLUDE_DIRS}
)
# define libgrampc sources
set(
grampc_SRCS
src/euler1.c
src/eulermod2.c
src/grampc_init.c
src/grampc_mess.c
src/grampc_run.c
src/grampc_setopt.c
src/grampc_setparam.c
src/heun2.c
src/probfct.c
src/ruku45.c
)
# define a libgrampc target
add_library(grampc ${grampc_SRCS})
# define a grampc_node target
add_executable(grampc_node src/grampc.cpp)
# now link our node to the library, and all the libraries from the other pkgs
target_link_libraries(grampc_node grampc ${catkin_LIBRARIES})
add_dependencies(grampc_node grampc_gencpp)
When I execute: catkin_make grampc, than the pkg compiles:
####
#### Running command: "make grampc -j4 -l4" in "/home/dentler/Workspace/catkin/build"
####
[100%] Built target grampc
But when I build the whole workspace with catkin_make I have the same issue like before?!
Linking CXX executable /home/dentler/Workspace/catkin/devel/lib/grampc/grampc_node
[100%] Built target record
[100%] Built target poller
CMakeFiles/grampc_node.dir/src/grampc.cpp.o: In function `grampc_IO_callback(grampc::grampc_IORequest_<std::allocator<void> >&, grampc::grampc_IOResponse_<std::allocator<void> >&)':
grampc.cpp:(.text+0x88): undefined reference to `grampc_run(typeGRAMPC*)'
grampc.cpp:(.text+0xaa): undefined reference to `grampc_setparam_vector(typeGRAMPC*, char*, double*)'
CMakeFiles/grampc_node.dir/src/grampc.cpp.o: In function `main':
grampc.cpp:(.text+0x45e): undefined reference to `grampc_init(typeGRAMPC**)'
grampc.cpp:(.text+0x477): undefined reference to `grampc_setopt_string(typeGRAMPC*, char*, char*)'
grampc.cpp:(.text+0x4a4): undefined reference to `grampc_setopt_real(typeGRAMPC*, char*, double)'
grampc.cpp:(.text+0x4d1): undefined reference to `grampc_setopt_real(typeGRAMPC*, char*, double)'
grampc.cpp:(.text+0x4ea): undefined reference to `grampc_setopt_string(typeGRAMPC*, char*, char*)'
grampc.cpp:(.text+0x517): undefined reference to `grampc_setopt_real(typeGRAMPC*, char*, double)'
grampc.cpp:(.text+0x544): undefined reference to `grampc_setopt_real(typeGRAMPC*, char*, double)'
grampc.cpp:(.text+0x571): undefined reference to `grampc_setopt_real(typeGRAMPC*, char*, double)'
grampc.cpp:(.text+0x59e): undefined reference to `grampc_setopt_real(typeGRAMPC*, char*, double)'
grampc.cpp:(.text+0x5cb): undefined reference to `grampc_setopt_real(typeGRAMPC*, char*, double)'
CMakeFiles/grampc_node.dir/src/grampc.cpp.o:grampc.cpp:(.text+0x5f8): more undefined references to `grampc_setopt_real(typeGRAMPC*, char*, double)' follow
CMakeFiles/grampc_node.dir/src/grampc.cpp.o: In function `main':
grampc.cpp:(.text+0x607): undefined reference to `grampc_printopt(typeGRAMPC*)'
grampc.cpp:(.text+0x631): undefined reference to `grampc_setparam_real(typeGRAMPC*, char*, double)'
grampc.cpp:(.text+0x65b): undefined reference to `grampc_setparam_real(typeGRAMPC*, char*, double)'
grampc.cpp:(.text+0x675): undefined reference to `grampc_setparam_int(typeGRAMPC*, char*, int)'
grampc.cpp:(.text+0x690): undefined reference to `grampc_setparam_vector(typeGRAMPC*, char*, double*)'
grampc.cpp:(.text+0x6ab): undefined reference to `grampc_setparam_vector(typeGRAMPC*, char*, double*)'
grampc.cpp:(.text+0x6c5): undefined reference to `grampc_setparam_int(typeGRAMPC*, char*, int)'
grampc.cpp:(.text+0x6e0): undefined reference to `grampc_setparam_vector(typeGRAMPC*, char*, double*)'
grampc.cpp:(.text+0x6fb): undefined reference to `grampc_setparam_vector(typeGRAMPC*, char*, double*)'
grampc.cpp:(.text+0x716): undefined reference to `grampc_setparam_vector(typeGRAMPC*, char*, double*)'
grampc.cpp:(.text+0x731): undefined reference to `grampc_setparam_vector(typeGRAMPC*, char*, double*)'
grampc.cpp:(.text+0x74c): undefined reference to `grampc_setparam_vector(typeGRAMPC*, char*, double*)'
grampc.cpp:(.text ...
Please do not overwrite your previous question with a new one. Either add information to your question or create a new question.
In addition to what @Dirk Thomas said: try cleaning out your current
build/
anddevel/
directories (as in: delete them), then invokecatkin_make
again. You cannot usecatkin_make
as a 1-on-1 substitute for regularmake
.@JanOr: if you make your current pkg available somewhere, I can take a look.
Thanks to your help, I learned a lot. As I changed the problem specification. I will open a question more specific soon. Thx
New question: http://answers.ros.org/question/20093...