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

Changing system, new problems gtk.h not found.

asked 2016-08-23 06:00:15 -0500

Rodrigo Lourenço gravatar image

updated 2018-07-07 16:47:50 -0500

jayess gravatar image

I'm trying to compile one file, that compiles fine in hydro, and gtk 2.0, but now the system as been upgraded to indigo, the file seems to compile but doesn't find gtk.h, I have gtk2.0 and gtk3.0 on my system, and I already compiled with gtk 2.0, no problems. My problem seems to be the catkin files. Can anyone give me a hand, pls.

CMakefile.txt

cmake_minimum_required(VERSION 2.8.3)
project(myVideoImageSubscriber)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
  cv_bridge
  image_transport
  sensor_msgs
)

find_package(PkgConfig REQUIRED)
find_package(OpenCV)

pkg_check_modules(gtk REQUIRED gtk+-2.0)
pkg_check_modules(OpenCV REQUIRED opencv)

catkin_package(
  CATKIN_DEPENDS roscpp std_msgs
)

include_directories(
  ${catkin_INCLUDE_DIRS}
  ${Bost_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
  ${OpenCV_CFLAGS}
  ${GTK_INCLUDE_DIRS}
  ${GTK_CFLAGS}
)

add_executable(myvideoimagesubscriber src/myVideoImageSubscriber.cpp)

add_dependencies(myvideoimagesubscriber cv_bridge roscpp std_msgs image_transport sensor_msgs)

target_link_libraries(myvideoimagesubscriber
   ${catkin_LIBRARIES}
   ${Boost_LIBRARIES}
   ${OpenCV_LIBRARIES}
   ${GTK_LIBRARIES}
)

Thank's in advance.

edit retag flag offensive close merge delete

Comments

Doesn't pkg_check_modules(..) store the contents of the .pc file it parses in the variable named by the first argument to it? So in your case gtk? CMake is case-sensitive, so I would expect all your GTK_* references later on to refer to non-existent variables then ..

gvdhoorn gravatar image gvdhoorn  ( 2016-08-23 06:15:59 -0500 )edit
1

Also: when posting CMakeLists.txt, please remove all the boilerplate comments from them (lines starting with #).

Finally: can you check GTK_INCLUDE_DIRS actually contains anything? Add something like

message(STATUS "GTK_INCLUDE_DIRS: ${GTK_INCLUDE_DIRS}")

to your CMakeLists.txt.

gvdhoorn gravatar image gvdhoorn  ( 2016-08-23 06:17:19 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-08-23 10:28:33 -0500

Rodrigo Lourenço gravatar image

Solved, it's quite simple.

First: change GTK to GTK2 Second: add this line - find_package(GTK2 COMPONENTS gtk)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-23 06:00:15 -0500

Seen: 328 times

Last updated: Jul 07 '18