Re: [CMake] 2 libs stuck together !

2014-10-15 Thread Johannes Zarl
Hi,

It would be a lot easier to help you if you tried to minimize the 
CMakeLists.txt file before posting it to the list. The file as you posted it 
contains many unrelated stuff and even commented-out lines.

Not wanting to look at the whole thing as it is, my advice to you is to search 
for the lines in which you add the pthread and opencv_calib3d lines. Maybe you 
used quotes incorrectly when adding these lines...

Cheers,
  Johannes

On Thursday, 9. October 2014, 14:06:29, jay75 wrote:
 i am working on ros indigo, ubuntu 14.04 trusty, opencv 2.4.9
 
 i get this message:
 /usr/bin/ld: cannot find -lopencv_calib3dlibpthread
 
 now, libpthread.so.0  and libopencv_calib3d.so are two separate libs in
 /usr/lib/x86_64-linux-gnu/, which i have added successfully to my
 link_libraries. what am i doing wrong? here is my cmakelists.txt :
 cmake_minimum_required(VERSION 2.8.3)
 project(hal_main)
 
 find_package(cmake_modules REQUIRED)
 find_package(Eigen REQUIRED)
 find_package(Boost REQUIRED thread date_time system filesystem
 program_options python )
 
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
 ## is used, also find other catkin packages
 find_package(catkin REQUIRED COMPONENTS
   actionlib
   actionlib_msgs
   message_generation
   roscpp
   rospy
   std_msgs
   genmsg
   visualization_msgs
   clam_controller
   clam_msgs
   pcl_ros
   cv_bridge
   eigen_conversions
   moveit_msgs
   geometry_msgs
   moveit_ros_planning
   moveit_ros_planning_interface
   tf
   tf_conversions
   moveit_simple_grasps
   cmake_modules
   moveit_core
   # eigen_conversions
 )
 
 
 
 find_package(OpenCV REQUIRED )
 find_package(OpenCV 2 REQUIRED )
 #find_package(OpenCV 2 REQUIRED COMPONENTS calib3dlibpthread)
 
 include_directories(${EIGEN_INCLUDE_DIRS})
 
 add_definitions(${EIGEN_DEFINITIONS})
 
 #SET( CMAKE_MODULE_PATH /usr/share/cmake-2.8/Modules/ )
 #set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
 ${CMAKE_SOURCE_DIR}/share/cmake_modules/cmake/Modules/)
 
 find_package(MySQL REQUIRED COMPONENTS libmysqlcppconn.so.7.1.1.3)
 include_directories(${MYSQL_INCLUDE_DIRS})
 add_definitions(${MYSQL_DEFINITIONS})
 #link_directories(/usr/lib/mysql/plugin/${MYSQL_LIBRARY_DIRS})
 
 
 
 #find_package(OpenCV2 REQUIRED)
 #find_package(mysql REQUIRED)
 ## System dependencies are found with CMake's conventions
 # find_package(Boost REQUIRED COMPONENTS system)
 
 
 ## Uncomment this if the package has a setup.py. This macro ensures
 ## modules and global scripts declared therein get installed
 ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
 # catkin_python_setup()
 
 
 ## Declare ROS messages, services and actions ##
 
 
 ## To declare and build messages, services or actions from within this
 ## package, follow these steps:
 ## * Let MSG_DEP_SET be the set of packages whose message types you use in
 ##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
 ## * In the file package.xml:
 ##   * add a build_depend and a run_depend tag for each package in
 MSG_DEP_SET
 ##   * If MSG_DEP_SET isn't empty the following dependencies might have
 been ## pulled in transitively but can be declared for certainty
 nonetheless: ## * add a build_depend tag for message_generation
 ## * add a run_depend tag for message_runtime
 ## * In this file (CMakeLists.txt):
 ##   * add message_generation and every package in MSG_DEP_SET to
  #find_package(catkin REQUIRED COMPONENTS actionlib_msgs geometry_msgs
 moveit_msgs )
 ##   * add message_runtime and every package in MSG_DEP_SET to
 ## catkin_package(CATKIN_DEPENDS ...)
 ##   * uncomment the add_*_files sections below as needed
 ## and list every .msg/.srv/.action file to be processed
 ##   * uncomment the generate_messages entry below
 ##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES
 ...)
 
 ## Generate messages in the 'msg' folder
  add_message_files(
FILES
instr_set_arm.msg
instr_set_legs.msg
object.msg
  )
 
 ## Generate services in the 'srv' folder
 # add_service_files(
 #   FILES
 #   Service1.srv
 #   Service2.srv
 # )
 
 ## Generate actions in the 'action' folder
  add_action_files(
FILES
arminstr.action
leginstr.action
objrecog_posit.action
sendcommand.action
 
  )
 
 ## Generate added messages and services with any dependencies listed here
  generate_messages(
DEPENDENCIES
actionlib_msgs
std_msgs
geometry_msgs
moveit_msgs
 
  )
 
  catkin_package(
   CATKIN_DEPENDS
   actionlib
   actionlib_msgs
   message_generation
   roscpp
   rospy
   std_msgs
   genmsg
   visualization_msgs
   clam_controller
   clam_msgs
   pcl_ros
   cv_bridge
   eigen_conversions
   moveit_msgs
   geometry_msgs
   moveit_ros_planning
   moveit_ros_planning_interface
   tf
   tf_conversions
   moveit_simple_grasps
   moveit_core
 

[CMake] 2 libs stuck together !

2014-10-09 Thread jay75
i am working on ros indigo, ubuntu 14.04 trusty, opencv 2.4.9

i get this message:
/usr/bin/ld: cannot find -lopencv_calib3dlibpthread

now, libpthread.so.0  and libopencv_calib3d.so are two separate libs in
/usr/lib/x86_64-linux-gnu/, which i have added successfully to my
link_libraries. what am i doing wrong? here is my cmakelists.txt :
cmake_minimum_required(VERSION 2.8.3)
project(hal_main)

find_package(cmake_modules REQUIRED)
find_package(Eigen REQUIRED)
find_package(Boost REQUIRED thread date_time system filesystem
program_options python )

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  actionlib
  actionlib_msgs
  message_generation
  roscpp
  rospy
  std_msgs
  genmsg
  visualization_msgs 
  clam_controller 
  clam_msgs
  pcl_ros
  cv_bridge
  eigen_conversions
  moveit_msgs
  geometry_msgs
  moveit_ros_planning 
  moveit_ros_planning_interface
  tf
  tf_conversions
  moveit_simple_grasps
  cmake_modules
  moveit_core 
  # eigen_conversions
)



find_package(OpenCV REQUIRED )
find_package(OpenCV 2 REQUIRED )
#find_package(OpenCV 2 REQUIRED COMPONENTS calib3dlibpthread)

include_directories(${EIGEN_INCLUDE_DIRS})

add_definitions(${EIGEN_DEFINITIONS})

#SET( CMAKE_MODULE_PATH /usr/share/cmake-2.8/Modules/ )
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/share/cmake_modules/cmake/Modules/)

find_package(MySQL REQUIRED COMPONENTS libmysqlcppconn.so.7.1.1.3)
include_directories(${MYSQL_INCLUDE_DIRS})
add_definitions(${MYSQL_DEFINITIONS})
#link_directories(/usr/lib/mysql/plugin/${MYSQL_LIBRARY_DIRS})



#find_package(OpenCV2 REQUIRED)
#find_package(mysql REQUIRED)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()


## Declare ROS messages, services and actions ##


## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend and a run_depend tag for each package in
MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependencies might have been
## pulled in transitively but can be declared for certainty nonetheless:
## * add a build_depend tag for message_generation
## * add a run_depend tag for message_runtime
## * In this file (CMakeLists.txt):
##   * add message_generation and every package in MSG_DEP_SET to
 #find_package(catkin REQUIRED COMPONENTS actionlib_msgs geometry_msgs
moveit_msgs )
##   * add message_runtime and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
##   * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
##   * uncomment the generate_messages entry below
##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES
...)

## Generate messages in the 'msg' folder
 add_message_files(
   FILES
   instr_set_arm.msg
   instr_set_legs.msg
   object.msg
 )

## Generate services in the 'srv' folder
# add_service_files(
#   FILES
#   Service1.srv
#   Service2.srv
# )

## Generate actions in the 'action' folder
 add_action_files(
   FILES
   arminstr.action
   leginstr.action
   objrecog_posit.action
   sendcommand.action

 )

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   actionlib_msgs
   std_msgs
   geometry_msgs
   moveit_msgs
   
 )

 catkin_package(
  CATKIN_DEPENDS
  actionlib
  actionlib_msgs
  message_generation
  roscpp
  rospy
  std_msgs
  genmsg
  visualization_msgs 
  clam_controller 
  clam_msgs
  pcl_ros
  cv_bridge
  eigen_conversions 
  moveit_msgs
  geometry_msgs
  moveit_ros_planning 
  moveit_ros_planning_interface
  tf
  tf_conversions
  moveit_simple_grasps
  moveit_core
#  INCLUDE_DIRS include
)
###
## catkin specific configuration ##
###
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: include/hal_main
## LIBRARIES: libraries you create in this project that dependent projects
also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also
need
catkin_package(
#  INCLUDE_DIRS include include/hal_main
${CMAKE_INSTALL_PREFIX}/include/hal_main
#  LIBRARIES hal_main
#