Updated by Vadim Pisarevsky over 10 years ago


The datasets module does not compile on Windows (using MinGW):
> opencv_contrib\modules\datasets\src\util.cpp: In function 'void cv::datasets::createDirectory(const string&)':
> opencv_contrib\modules\datasets\src\util.cpp:77:35: error: 'S_IRWXG' was not declared in this scope
> mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
> opencv_contrib\modules\datasets\src\util.cpp:77:45: error: 'S_IROTH' was not declared in this scope
> mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
> opencv_contrib\modules\datasets\src\util.cpp:77:55: error: 'S_IXOTH' was not declared in this scope
> mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
> opencv_contrib\modules\datasets\src\util.cpp: In function 'void cv::datasets::getDirList(const string&, std::vector<std::basic_string<char> >&)':
> opencv_contrib\modules\datasets\src\util.cpp:87:55: error: 'alphasort' was not declared in this scope
> int n = scandir(dirName.c_str(), &namelist, NULL, alphasort);
> opencv_contrib\modules\datasets\src\util.cpp:87:64: error: 'scandir' was not declared in this scope
> int n = scandir(dirName.c_str(), &namelist, NULL, alphasort);

Windows does not have the concept group and other permissions in its file system, hence, these macros are not defined. The problem could be solved be adding:
> /* These aren't provided by either MingW or MSVC */
> #if defined WIN32 || defined _WIN32
> > #define S_IRGRP 0
> > #define S_IWGRP 0
> > #define S_IXGRP 0
> > #define S_IRWXG 0
> > #define S_IROTH 0
> > #define S_IWOTH 0
> > #define S_IXOTH 0
> > #define S_IRWXO 0
> #endif

Back