Ask Your Question
0

catkin_make error

asked 2015-04-01 22:39:42 -0500

whenand gravatar image

updated 2015-04-02 00:26:22 -0500

William gravatar image

hi, i am a beginner of learning ROS.

I write a node of image processing with Halcon library. As far as I know, it should be configured well, in CMakeList.txt, to make the node pass the compile. The following is my CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(daheng_try_cmdvel)
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  tf
)

generate_messages(  DEPENDENCIES  std_msgs )
catkin_package()

include_directories(
${catkin_INCLUDE_DIRS}
/home/zcn/Downloads/daheng-1.3.1305.9271-32/sdk/include
/home/zcn/Downloads/daheng-1.3.1305.9271-32/sdk/genicam/library/CPP/include
/home/zcn/Downloads/halcon-7.0.4-linux-x86/include
/home/zcn/Downloads/halcon-7.0.4-linux-x86/include/cpp
)

link_directories(
/usr/lib/
/home/zcn/Downloads/daheng-1.3.1305.9271-32/sdk/genicam/bin/Linux32_i86/
/home/zcn/Downloads/daheng-1.3.1305.9271-32/sdk/genicam/bin/Linux32_i86/GenApi/Generic/
/home/zcn/Downloads/halcon-7.0.4-linux-x86/lib/i586-linux2.2
)

add_executable(daheng_try_cmdvel_node src/daheng_try_cmdvel_node.cpp)

target_link_libraries(daheng_try_cmdvel_node
${catkin_LIBRARIES}

gxiapi
pthread
dhgentl

GCBase_gcc40_v2_3
GenApi_gcc40_v2_3 
log4cpp_gcc40_v2_3
Log_gcc40_v2_3
MathParser_gcc40_v2_3
Xalan-C_gcc40_v1_10
XalanMessages_gcc40_v1_10
Xerces-C_gcc40_v2_7
XMLLoader_gcc40_v2_3

halconcpp
)
add_dependencies(daheng_try_cmdvel_node daheng_try_cmdvel_generate_messages_cpp)

But, when I catkin_make, it shows:

CMakeFiles/daheng_try_cmdvel_node.dir/src/daheng_try_cmdvel_node.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
daheng_try_cmdvel_node.cpp:(.text+0x772): undefined reference to `HTuple::HTuple()'
CMakeFiles/daheng_try_cmdvel_node.dir/src/daheng_try_cmdvel_node.cpp.o: In function `HTuple::~HTuple()':
daheng_try_cmdvel_node.cpp:(.text._ZN6HTupleD2Ev[_ZN6HTupleD5Ev]+0xc): undefined reference to `vtable for HTuple'
collect2: ld return 1
make[2]: *** [/home/zcn/catkin_ws/devel/lib/daheng_try_cmdvel/daheng_try_cmdvel_node] error 1
make[1]: *** [daheng_try_cmdvel/CMakeFiles/daheng_try_cmdvel_node.dir/all]  error  2
make: *** [all]  error  2
Invoking "make" failed

why?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-04-02 00:30:09 -0500

William gravatar image

This appears to be a generic C++ question, not related to ROS or catkin. It looks like you are using a class called HTuple which you have included the header for, but have neglected to link the library which contains the implementation. Your CMakeLists.txt has some pretty unorthodox stuff in it.

edit flag offensive delete link more

Comments

Thanks William, how to fix this problem? I search in the web, they mentioned something about g++ compiling. here, i use catkin_make.

whenand gravatar image whenand  ( 2015-04-28 02:46:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-04-01 22:34:30 -0500

Seen: 318 times

Last updated: Apr 02 '15