Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » how to solve error message "no such file or directory" for opencv
how to solve error message "no such file or directory" for opencv [message #1754178] Wed, 15 February 2017 04:57 Go to next message
kiki sarpong is currently offline kiki sarpongFriend
Messages: 1
Registered: February 2017
Junior Member
index.php/fa/28460/0/

trying to use opencv on eclipse. I have included all the files i've been told to include according to a book im using but i still get this error with the sample code.
can i get some help on how to solve this thanks
  • Attachment: Capture.PNG
    (Size: 111.60KB, Downloaded 3371 times)
Re: how to solve error message "no such file or directory" for opencv [message #1754266 is a reply to message #1754178] Wed, 15 February 2017 22:21 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You need to tell both the compiler and the indexer where the opencv header files are located.


The include directories can be found by executing (in a command terminal):
In my system they are in: /usr/include/opencv
Quote:
$ pkg-config --cflags opencv
-I/usr/include/opencv

You tell the compiler where they are (assuming Exlipse is generating the Makefile) at
Project --> Properties --> C/C++ Build --> Settings under Includes for each compiler used.
Drop the -I and put the rest in the top pane (the paths pane),


The indexer needs to be to told at Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc.
If the include path for opencv doesn't apper under Managed Build Settings then
1) ensue the Managed Build provider is enabled in the Providers tab; the path should be found at the next build
2) You can also set the directory as a user entry on the Entries tab

You also need to tell the linker where and the libraries are and which libraries to use:
Project --> Properties --> C/C++ Build --> Settings --> Linker --> Libraries

Run pkg-config --libs opencv in a terminal
Add the output preceded by -L (without the -L) to the bottom pane
Add the output preceded by -l (without the -l) to the top pane
They have to be added one at a time -- a bit tedious.

Another option is to add `pkg-config --libs opencv` to the linker command:
${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} `pkg-config opencv --libs`
Note the back tics around the pkg-config command. It will likely only work under Linux.

http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_general_sd_entries.htm
http://docs.opencv.org/3.2.0/d7/d16/tutorial_linux_eclipse.html

[Updated on: Thu, 16 February 2017 17:34]

Report message to a moderator

Previous Topic:TCF debugging causes connection refused to Pulseaudio server
Next Topic:Eclipse Neon 2 Dark Theme still bust?
Goto Forum:
  


Current Time: Fri Apr 26 21:00:11 GMT 2024

Powered by FUDForum. Page generated in 0.03488 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top