c - How to get opencv include work in kubuntu? (Includes solution to how to include and link in netbeans 6.7.1) -
I have installed opencv c libraries from package management in my kbantu 9.10. I have written a small image modification program which uses those libraries, but I can not compile it, because every time I try to compile, I get an error message that the OpenCV library does not work Can get it.
Those header files are in the folder / usr / include / opencv /
but still the compiler says that the function is not available.
I have tried to include them basically
#include & lt; Highgui.h & gt; # Include & lt; Cv.h & gt; In Netbeans,
command (and I have set Netbeen to search header files from that specific directory) and also tried to include them with full path.
Add # & lt; /usr/include/opencv/highgui.h> Include # and //// Besides this, I tried to compile my source file in the console (with full path), but then I got the same error message that those libraries could not get the job done. Edit:
I get the error message
Undefined context for 'function_name'
I get the error for every celebration that I try to use from that OpenCiv Library.
Any idea how to fix that problem?
Edit II:
Another Netbeans is using 6.7.1 and it has a problem, here's a copy of the solution pasted from another website:
Here, I think that you have successfully installed the OpenCiv Library manually or via package management.
- Open Netbeans then do the following: Tools -> Options -> C / C ++ -> Code Assistance -> Include Directories (for me, / usr / local / include / opencv) Select
- Create new project, then: right click on Project Name -> Properties -> Build -> C / C ++ compiler - Include Dir to include Ectories Directories: / usr / local / Include / opencv
- Right click on Project Name -> Properties -> Build -> Linker -> Include Directories: / usr / local / include / opencv Extra and Qualification: - I / usr / local / include / opencv -l / usr / local / lib -lcxcore -lcv -lhighgui -lcvaux -lml
then program writing and compilation !!
"undefined context" is a linky error. You forgot to add your application against OpenCiv libraries Make sure you link against CV and Hygu (LCV-LeighGui) or use the PKG-config call provided by Tobu. I also want the second request for more detailed error messages.
Comments
Post a Comment