Ask Your Question
0

Error Compiling Traincascade in OpenCV 3.0 [closed]

asked 2015-12-13 05:14:11 -0600

Hi All,

I am using Archlinux and successfully compile OpenCV 3.0. Then, I want to learn about traincascade and try to compile it via Eclipse. I've follow instruction how to use OpenCV in Eclipse, but I got this Error when try to Build All.

/usr/local/include/opencv2/core/private.hpp:48:4: error: #error this is a private header which should not be used from outside of the OpenCV library
#  error this is a private header which should not be used from outside of the OpenCV library
^
subdir.mk:51: recipe for target 'old_ml_boost.o' failed
make: *** [old_ml_boost.o] Error 1

After searching about this error in any forums, many answers leads to comment off line that use it. But, if I implement that, it generates another error. Here is the example:

../old_ml_precomp.hpp:356:67: error: ‘Split’ has not been declared
     DTreeBestSplitFinder( const DTreeBestSplitFinder& finder, Split );
                                                               ^
../old_ml_precomp.hpp:358:39: error: ‘BlockedRange’ does not name a type
     virtual void operator()(const BlockedRange& range);
                                   ^
../old_ml_precomp.hpp:371:77: error: ‘Split’ has not been declared
     ForestTreeBestSplitFinder( const ForestTreeBestSplitFinder& finder, Split );
                                                                         ^
../old_ml_precomp.hpp:372:39: error: ‘BlockedRange’ does not name a type
     virtual void operator()(const BlockedRange& range);
                                   ^
subdir.mk:51: recipe for target 'old_ml_boost.o' failed
make: *** [old_ml_boost.o] Error 1

Please help me.

Thank you.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by kosongduadua
close date 2015-12-25 20:32:47.630823

Comments

"...and try to compile it via Eclipse" - yikes !

rather than messing with eclipse, go back to the step, where you compiled opencv, add -DBUILD_opencv_apps to the cmake cmdline, and rerun the whole cmake, make, make install thing

berak gravatar imageberak ( 2015-12-13 05:59:17 -0600 )edit

Hi,

After do what you suggest, can I modify traincascade code? I want to make some modification in traincascade later

kosongduadua gravatar imagekosongduadua ( 2015-12-13 06:18:26 -0600 )edit
1

well, above was the "fast lane" to obtain the binary.

if you want to use eclipse, still generate your project using cmake

berak gravatar imageberak ( 2015-12-13 07:13:05 -0600 )edit

I f you want to use Eclipse, you have to generate the project with the correct option, I used something like:

ccmake -G "Eclipse CDT4 - Unix Makefiles" link_to_opencv_src link_to_build_directory

Then, import your project into Eclipse:

File > Import... > General > Existing Projects into Workspace
Eduardo gravatar imageEduardo ( 2015-12-13 10:14:51 -0600 )edit

1 answer

Sort by » oldest newest most voted
-1

answered 2015-12-25 20:32:09 -0600

Hi All,

I can solved this error by editing private.hpp in opencv2/core/private.hpp and remove this line

#ifndef __OPENCV_BUILD
#  error this is a private header which should not be used from outside of the OpenCV library
#endif

Thanks,

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-12-13 05:14:11 -0600

Seen: 1,943 times

Last updated: Dec 25 '15