Ask Your Question
0

g++ compiler not working for opencv installed inside ros-fuerte

asked 2014-03-15 11:46:28 -0500

Latif Anjum gravatar image

Hi,

I have installed ros-fuerte-desktop-full and with it opencv got installed. Opencv code is working inside any ros package that I create. However, some times I like to work outside ROS and have Geany installed. I have given the following set build command to geany for compilation

g++ "%f" `pkg-config --cflags --libs opencv` -o "%e"

When I try to build it says:

Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable. No package 'opencv' found.

My PKG_CONFIG_PATH already contains opencv.pc file. Here is the output of some flags:

#echo $PKG_CONFIG_PATH
/opt/ros/fuerte/lib/pkgconfig:   //this path contains opencv.pc

#pkg-config --cflags --libs opencv
-I/opt/ros/fuerte/include/opencv -I/opt/ros/fuerte/include  -L/opt/ros/fuerte/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_ts -lopencv_video -lopencv_videostab

#pkg-config --libs opencv
-L/opt/ros/fuerte/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_ts -lopencv_video -lopencv_videostab

Any help would be greatly appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-03-16 14:40:32 -0500

ahendrix gravatar image

It looks like you're on the right path.

My best guess is that something inside the build system for Geany is unsetting or overriding your PKG_CONFIG_PATH. It may also be worth invoking Geany from a terminal after you've sourced the ROS setup files, instead of launching it directly from the GUI.

edit flag offensive delete link more

Comments

This is pretty weird. Yes something inside Geany is doing making the shift. Anyway, I can compile even using terminal by command: g++ filename.cpp `pkg-config --cflags --libs opencv` -o output. Looks fine for me. Thanks.

Latif Anjum gravatar image Latif Anjum  ( 2014-03-17 23:55:33 -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: 2014-03-15 11:46:28 -0500

Seen: 724 times

Last updated: Mar 16 '14