protobuf opencv_contrib

asked 2015-10-02 03:49:35 -0600

peter_cz gravatar image

updated 2015-10-02 03:55:07 -0600

berak gravatar image

Dears,

I'm trying to compile opencv_contrib and I am getting errors as follows

[ 54%] Building CXX object modules/dnn/3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/compiler/importer.cc.obj
In file included from  C:\opencv\sources_contrib\modules\dnn\3rdparty\protobuf\src\google\protobuf\compiler\importer.cc:38:0:
c:\mingw\include\unistd.h:78:11: error: '_cdecl' does not name a type
 _EXTERN_C _cdecl __MINGW_NOTHROW
           ^
In file included from C:\opencv\sources_contrib\modules\dnn\3rdparty\protobuf\src\google\protobuf\compiler\importer.cc:38:0:
c:\mingw\include\unistd.h:104:1: error: '_cdecl' does not name a type
 _cdecl __MINGW_NOTHROW
 ^
c:\mingw\include\unistd.h: In function 'int nanosleep(const timespec*, timespec*)':
c:\mingw\include\unistd.h:114:51: error: '__mingw_sleep' was not declared in this scope
     ? (unsigned)(-1) : (unsigned)(period->tv_nsec));
                                                   ^
c:\mingw\include\unistd.h: At global scope:
c:\mingw\include\unistd.h:125:28: error: expected initializer before 'usleep'
 int _cdecl __MINGW_NOTHROW usleep( useconds_t )__MINGW_ATTRIB_DEPRECATED;
                            ^
c:\mingw\include\unistd.h: In function 'int usleep(useconds_t)':
c:\mingw\include\unistd.h:129:73: error: '__mingw_sleep' was not declared in this scope
 int usleep( useconds_t period ){ return __mingw_sleep( 0, 1000 * period ); }
                                                                         ^
c:\mingw\include\unistd.h: At global scope:
c:\mingw\include\unistd.h:138:33: error: expected initializer before 'sleep'
 unsigned _cdecl __MINGW_NOTHROW sleep( unsigned );
                                 ^
c:\mingw\include\unistd.h: In function 'unsigned int sleep(unsigned int)':
c:\mingw\include\unistd.h:142:68: error: '__mingw_sleep' was not declared in this scope
 unsigned sleep( unsigned period ){ return __mingw_sleep( period, 0 ); }
                                                                    ^
c:\mingw\include\unistd.h: At global scope:
c:\mingw\include\unistd.h:153:12: error: expected initializer before 'ftruncate'
 int _cdecl ftruncate( int, off_t );
            ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from C:\opencv\sources_contrib\modules\dnn\3rdparty\protobuf\src\google\protobuf\compiler\importer.cc:45:
c:\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
 { return (float)(_hypot (x, y)); }
                              ^
modules\dnn\3rdparty\protobuf\CMakeFiles\libprotobuf.dir\build.make:62: recipe for target 'modules/dnn/3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/compiler/importer.cc.obj' failed
mingw32-make[2]: *** [modules/dnn/3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/compiler/importer.cc.obj] Error 1
CMakeFiles\Makefile2:5306: recipe for target 'modules/dnn/3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all' failed
mingw32-make[1]: *** [modules/dnn/3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

Did you experienced such behavior? Is there any solution for this?

Thank you.

Best regards.

edit retag flag offensive close merge delete

Comments

i guess, you'll have to report an issue and disable the dnn module for now:

cmake -DBUILD_opencv_dnn=OFF
berak gravatar imageberak ( 2015-10-02 03:57:33 -0600 )edit
1

I did report an issue. I use CMake GUI howto do "cmake -DBUILD_opencv_dnn=OFF" within GUI?

peter_cz gravatar imagepeter_cz ( 2015-10-02 05:11:26 -0600 )edit

just tick off the BUILD_opencv_dnn entry (should be somewhere at the top)

berak gravatar imageberak ( 2015-10-02 05:57:45 -0600 )edit