|
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 |
David Vavra 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
|
|
|
Powered by
FUDForum. Page generated in 0.05305 seconds