LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-01-2010, 12:45 PM   #1
logickills
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
OpenCV programming - highgui.h: no such file or directory


I installed OpenCV and am trying the example programs. When I try to compile like in the tutorial it is not finding highgui.h.

I have 64 bit Mint if that helps at all.

Any input would be helpful, thanks.

Last edited by logickills; 07-01-2010 at 12:49 PM.
 
Old 07-01-2010, 02:29 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,135

Rep: Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639
OpenCV libraries
http://packages.debian.org/sid/libhighgui-dev

sudo apt-get install libhighgui-dev

It is very easy to find highgui.h :
http://packages.debian.org/search?su...ords=highgui.h
Just enter highgui.h in "Search" → 'package contents'

And the libhighgui-dev file list
http://packages.debian.org/sid/amd64...i-dev/filelist
/usr/include/opencv/highgui.h
..

Last edited by knudfl; 07-01-2010 at 02:33 PM.
 
Old 07-01-2010, 03:06 PM   #3
logickills
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Original Poster
Rep: Reputation: 0
I installed those packages and I am still getting the same errors. I went ahead and navigated to /usr/include/opencv and I see highgui.h - the problem is g++ isn't seeing it.
 
Old 07-01-2010, 04:28 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,135

Rep: Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639
Well, the file(s) can be included like this in your program :

#include <opencv/highgui.h>

Or in a Makefile + probably a couple of other methods.

..
 
Old 10-24-2011, 07:49 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,623
Blog Entries: 29

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by knudfl View Post
sudo apt-get install libhighgui-dev
Does this have some other name for Suse? Zypper is clueless about this.
I'd prefer zypper rather than...

http://opencv.willowgarage.com/wiki/...CV_on_Linux.3F
Code:
# zypper install libcv1 libcv-dev libcvaux1 libcvaux-dev libhighgui1 libhighgui-dev
Loading repository data...
Reading installed packages...
'libcv-dev' not found in package names. Trying capabilities.
No provider of 'libcv-dev' found.
'libcv1' not found in package names. Trying capabilities.
No provider of 'libcv1' found.
'libcvaux-dev' not found in package names. Trying capabilities.
No provider of 'libcvaux-dev' found.
'libcvaux1' not found in package names. Trying capabilities.
No provider of 'libcvaux1' found.
'libhighgui-dev' not found in package names. Trying capabilities.
No provider of 'libhighgui-dev' found.
'libhighgui1' not found in package names. Trying capabilities.
No provider of 'libhighgui1' found.
Resolving package dependencies...
Nothing to do.
I have opencv installed. opencv-2.1.0-2.37.x86_64
Code:
linux-dopx:~ # opencv_
opencv_createsamples  opencv_haartraining   opencv_performance    opencv_traincascade   

linux-dopx:~ #
The thread is old, I know, but I also received the exact same error, and I think
it is better to keep all the information in one place.

Last edited by TheIndependentAquarius; 10-24-2011 at 07:53 AM.
 
Old 10-24-2011, 08:12 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,135

Rep: Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639
#5, Anisha

Quote:
Does this have some other name for Suse?
Yes : Is included in the package 'opencv-devel'
Will provide /usr/lib(64)/libhighgui.so, /usr/include/opencv/highgui.h, etc.
( ? No highgui.hpp, libhighgui.a in the Suse package ? )


Example finding e.g. highgui.h for Suse : http://rpm.pbone.net/
>> Search > Advanced Search : highgui.h, and tick "OpenSuSE".


Regards
.

Last edited by knudfl; 10-24-2011 at 11:07 AM.
 
1 members found this post helpful.
Old 12-28-2011, 10:56 AM   #7
hxr99
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Rep: Reputation: Disabled
I use Linux Mint,too.
If you are going to compile any opencv project in C/C++, you should give the `pkg-config --libs --cflags opencv` arguments.
It should be like this: g++ `pkg-config --libs --cflags opencv` myProject.cpp -o myProject

If you don't mind, better go with an IDE like code::block or Qt, I've posted a tutorial how to connect the OpenCV library with the code::block.
This is the link for the code::block : http://hxr99.blogspot.com/2011/12/ho...-block-in.html
This is the link for the Qt : http://hxr99.blogspot.com/2011/12/op...ing-image.html
There are a few examples too.

Hope it will be useful for all LQers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCV compilation problem (add directory for including header files) maikki Programming 2 01-07-2009 09:07 AM
Copying a single file into each directory of a directory tree mlapl1 Linux - Newbie 2 06-27-2007 11:18 PM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-04-2006 12:08 AM


All times are GMT -5. The time now is 01:17 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration