LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-31-2012, 03:33 AM   #1
prithvi_patel
LQ Newbie
 
Registered: Mar 2012
Location: mahesana, Gujarat. India
Posts: 1

Rep: Reputation: Disabled
how to solve errors while compiling opencv program with header file? like g++ `pkg-c


prithvi@~ $g++ `pkg-config opencv --cflags --libs` ic.c -o ic
In file included from ic.c:1:
/usr/local/include/opencv/highgui.h:45:33: error: opencv2/core/core_c.h: No such file or directory
/usr/local/include/opencv/highgui.h:46:33: error: opencv2/core/core.hpp: No such file or directory
/usr/local/include/opencv/highgui.h:47:39: error: opencv2/highgui/highgui_c.h: No such file or directory
/usr/local/include/opencv/highgui.h:48:39: error: opencv2/highgui/highgui.hpp: No such file or directory
ic.c: In function ‘int main(int, char**)’:
ic.c:4: error: ‘IplImage’ was not declared in this scope
ic.c:4: error: ‘img’ was not declared in this scope
ic.c:4: error: ‘cvLoadImage’ was not declared in this scope
ic.c:6: error: ‘cvSaveImage’ was not declared in this scope
ic.c:7: error: ‘cvReleaseImage’ was not declared in this scope
 
Old 04-05-2012, 02:38 AM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
: No such file or directory
install those headers

the non standard location of the opencv source "/usr/local/include/opencv/"
the header in there is looking in the DEFAULT /usr/include for
"opencv2/highgui/highgui_c.h"
this file is being looked for
/usr/include/opencv2/highgui/highgui_c.h

it is not looking in /usr/local/include/......

you should have a /usr/local/lib/pkgconfig from the source install of opencv to /usr/local

add that location to the $PKG_CONFIG_PATH
add the /usr/local/lib location to the $LD_LIBRARY_PATH
and add the /usr/local/include to your $C_INCLUDE_PATH & $CPLUS_INCLUDE_PATH

i put those in a /etc/bashrc.local file and export the variables
 
  


Reply



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
c program compiling with header file ant___man Programming 4 12-15-2011 03:53 PM
while compiling c programme it's showing errors in header files mprabu20 Programming 1 04-08-2006 02:07 AM
Missing header GLTK in compiling an openGL program BorgAssimilator Programming 1 01-23-2006 09:07 PM
how to solve parse errors in C program?? divya Linux - Software 4 04-01-2004 11:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:54 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration