Ask Your Question
2

Compiling freak_demo.cpp - error

asked 2012-07-16 17:15:13 -0600

imran gravatar image

updated 2012-07-20 07:38:48 -0600

Has anyone been able to compile freak_demo.cpp in OpenCV 2.4.2? Everything else compiles besides this. I get this error,

compiling freak_demo.cpp
freak_demo.cpp: In function ‘int main(int, char**)’:
freak_demo.cpp:93:5: error: ‘FREAK’ was not declared in this scope
freak_demo.cpp:93:11: error: expected ‘;’ before ‘extractor’
freak_demo.cpp:110:5: error: ‘extractor’ was not declared in this scope

This is what I get after compiling the samples/cpp/ folder:

compiling *.c
compiling 3calibration.cpp
compiling OpenEXRimages_HighDynamicRange_Retina_toneMapping.cpp
compiling OpenEXRimages_HighDynamicRange_Retina_toneMapping_video.cpp
compiling bagofwords_classification.cpp
compiling bgfg_segm.cpp
compiling brief_match_test.cpp
compiling build3dmodel.cpp
compiling calibration.cpp
compiling calibration_artificial.cpp
compiling camshiftdemo.cpp
compiling chamfer.cpp
compiling connected_components.cpp
compiling contours2.cpp
compiling convexhull.cpp
compiling cout_mat.cpp
compiling delaunay2.cpp
compiling demhist.cpp
compiling descriptor_extractor_matcher.cpp
compiling detection_based_tracker_sample.cpp
compiling detector_descriptor_evaluation.cpp
compiling detector_descriptor_matcher_evaluation.cpp
compiling dft.cpp
compiling distrans.cpp
compiling drawing.cpp
compiling edge.cpp
compiling em.cpp
compiling facerec_demo.cpp
facerec_demo.cpp: In function ‘int main(int, const char**)’:
facerec_demo.cpp:136:12: error: ‘class cv::FaceRecognizer’ has no member named ‘set’
facerec_demo.cpp:143:30: error: ‘class cv::FaceRecognizer’ has no member named ‘getMat’
facerec_demo.cpp:145:20: error: ‘class cv::FaceRecognizer’ has no member named ‘getMat’
compiling fback.cpp
compiling ffilldemo.cpp
compiling filestorage.cpp
filestorage.cpp: In function ‘int main(int, char**)’:
filestorage.cpp:165:52: error: ‘MEMORY’ is not a member of ‘cv::FileStorage’
filestorage.cpp:175:51: error: ‘MEMORY’ is not a member of ‘cv::FileStorage’
filestorage.cpp:175:73: error: ‘FORMAT_YAML’ is not a member of ‘cv::FileStorage’
filestorage.cpp:181:31: error: ‘class cv::FileStorage’ has no member named ‘releaseAndGetString’
compiling fitellipse.cpp
compiling freak_demo.cpp
freak_demo.cpp: In function ‘int main(int, char**)’:
freak_demo.cpp:93:5: error: ‘FREAK’ was not declared in this scope
freak_demo.cpp:93:11: error: expected ‘;’ before ‘extractor’
freak_demo.cpp:110:5: error: ‘extractor’ was not declared in this scope
compiling gencolors.cpp
compiling generic_descriptor_match.cpp
compiling grabcut.cpp
compiling houghcircles.cpp
compiling houghlines.cpp
compiling hybridtrackingsample.cpp
compiling image.cpp
compiling imagelist_creator.cpp
compiling inpaint.cpp
compiling kalman.cpp
compiling kmeans.cpp
compiling laplace.cpp
compiling latentsvm_multidetect.cpp
compiling letter_recog.cpp
compiling linemod.cpp
compiling lkdemo.cpp
compiling logpolar_bsm.cpp
compiling matcher_simple.cpp
compiling matching_to_many_images.cpp
compiling meanshift_segmentation.cpp
compiling minarea.cpp
compiling morphology2.cpp
compiling multicascadeclassifier.cpp
compiling opencv_version.cpp
compiling openni_capture.cpp
compiling peopledetect.cpp
compiling phase_corr.cpp
compiling point_cloud.cpp
compiling points_classifier.cpp
compiling retinaDemo.cpp
compiling rgbdodometry.cpp
compiling segment_objects.cpp
compiling select3dobj.cpp
compiling squares.cpp
compiling starter_imagelist.cpp
compiling starter_video.cpp
compiling stereo_calib.cpp
compiling stereo_match.cpp
compiling stitching.cpp
compiling stitching_detailed.cpp
compiling video_dmtx.cpp
compiling video_homography.cpp
compiling videostab.cpp
compiling watershed.cpp
edit retag flag offensive close merge delete

Comments

you'd better specify the OS you developing for and the source code...

Andrey Pavlenko gravatar imageAndrey Pavlenko ( 2012-07-17 03:53:26 -0600 )edit

Using Ubuntu 12.04 64bit. The source code is freakdemo.cpp in the C++ samples folder in OpenCV (OpenCV-2.4.2/samples/cpp/freakdemo.cpp)

imran gravatar imageimran ( 2012-07-17 07:58:30 -0600 )edit

SOLVED! Update cmake to 2.8.8

imran gravatar imageimran ( 2012-07-22 08:43:27 -0600 )edit

1 answer

Sort by » oldest newest most voted
3

answered 2012-07-18 12:18:27 -0600

sammy gravatar image

You need to specify the include path when you compile

in Ubuntu, add

gcc [... other options]  -I/path/to/opencv/module/include/
edit flag offensive delete link more

Comments

@sammy Can you give an example of an include path you will use because I can't seem to find it. I also don't think that is the problem because the "include" files are included since everything else compiles except facerec.cpp, filestorage.cpp and freakdemo.cpp. Check the edited question to see what I get after compiling the samples/cpp/ folder.

imran gravatar imageimran ( 2012-07-20 07:35:31 -0600 )edit

It seems the Makefile has some problems. It crashes in the newly added samples. I hope someone with more experience in OpenCV builds will look at it. You may want to file a bug on it.

sammy gravatar imagesammy ( 2012-07-20 07:43:16 -0600 )edit

Question Tools

Stats

Asked: 2012-07-16 17:15:13 -0600

Seen: 2,014 times

Last updated: Jul 20 '12