Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv::ml not compiling in opencv 3.0

I downloaded, built, and installed OpenCV 3.0.0 on Ubuntu 14.10, 64-bit. I have a C++ project in NetBeans that compiles, links, and runs. I am now trying to follow the tutorial here: http://docs.opencv.org/3.0-beta/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.html#source-code

I have the "#includes" and the "using namespaces" as specified in the tutorial, and NetBeans and g++ both seem able to find these things. But when I add some ml-specific code such as "SVM::Params params;", I get compiler errors, below.

g++ -std=c++11   -c -g -I/usr/local/include -I/usr/include/libxml2/ -I/usr/local/include/opencv2 -MMD -MP -MF "build/Debug/GNU-Linux-x86/my_file.o.d" -o build/Debug/GNU-Linux-x86/my_file.o my_file.cpp
my_file.cpp: In function ‘void mynamespace::myFunction()’:
my_file.cpp:153:3: error: ‘Params’ is not a member of ‘cv::ml::SVM’
   SVM::Params params;
   ^

What might I be missing?