c++ - can't find openCV head file -


recently i'm learning opencv. followed tutorial on opencv website. http://docs.opencv.org/doc/tutorials/core/how_to_scan_images/how_to_scan_images.html#howtoscanimagesopencv

however, when compile code using following command

g++ loadimage.cpp -o loadimage 

the command line shows:

fatal error: 'opencv2/core/core.hpp' file not found #include <opencv2/core/core.hpp>      ^ 

i installed opencv brew, think ok. use emacs edit , g++ compile code directly, problem? searched similar problems refer xcode environment. help!

you need tell g++ can find header files. recommend setup either eclipse or other ide can handle stuff (like qt creator or many others). can follow setup guides opencv instructions, if needed.

[edit: note know emacs can setup handle things include , library paths, have no idea how, hence recommendation full scale ide]

you can specify path includes on command line -i, should work. example:

g++ -i/path/to/opencv-2.4.9/build/include loadimage.cpp -o loadimage 

there environment variables can set don't have specify every call (see this page complete list, cpath , it's variants might of interest.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -