###実現したい事
FreeBSD11.1にてOpenCV3.4.1をビルドするためにmakeコマンドを実行したのですが、エラーが出て中断してしまいました。以前このサイトでビルドに成功した人はいないらしいという情報を得たのですが、諦めきれませんでした。この対処法ご存知の方回答お願いします。
###エラー
-- Configuring done -- Generating done -- Build files have been written to: /home/ユーザ名/support/src/opencv/opencv-3.4.1/build root@ホスト名:/home/ユーザ名/support/src/opencv/opencv-3.4.1/build # make Scanning dependencies of target gen-pkgconfig [ 0%] Generate opencv.pc [ 0%] Built target gen-pkgconfig Scanning dependencies of target ippiw [ 0%] Building C object 3rdparty/ippiw/CMakeFiles/ippiw.dir/src/iw_core.c.o In file included from /home/ユーザ名/support/src/opencv/opencv-3.4.1/build/3rdparty/ippicv/ippiw_lnx/src/iw_core.c:58: /usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>" #error "<malloc.h> has been replaced by <stdlib.h>" ^ 1 error generated. *** Error code 1 Stop. make[2]: stopped in /home/ユーザ名/support/src/opencv/opencv-3.4.1/build *** Error code 1 Stop. make[1]: stopped in /home/ユーザ名/support/src/opencv/opencv-3.4.1/build *** Error code 1 Stop. make: stopped in /home/ユーザ名/support/src/opencv/opencv-3.4.1/build
###試したこと
cmake3.10.2でconfigureを行った後にmakeコマンドで実行しました。
###エラーその2
/home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:108:17: error: variable has incomplete type 'struct stat' struct stat stat_buf; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:108:12: note: forward declaration of 'stat' struct stat stat_buf; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:129:23: error: use of undeclared identifier 'rmdir' bool result = rmdir(path.c_str()) == 0; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:141:23: error: use of undeclared identifier 'unlink' bool result = unlink(path.c_str()) == 0; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:380:17: error: allocation of incomplete type 'cv::utils::fs::FileLock::Impl' : pImpl(new Impl(fname)) ^~~~ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/include/opencv2/core/utils/filesystem.private.hpp:55:12: note: forward declaration of 'cv::utils::fs::FileLock::Impl' struct Impl; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:386:5: warning: deleting pointer to incomplete type 'cv::utils::fs::FileLock::Impl' may cause undefined behavior [-Wdelete-incomplete] delete pImpl; ^ ~~~~~ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/include/opencv2/core/utils/filesystem.private.hpp:55:12: note: forward declaration of 'cv::utils::fs::FileLock::Impl' struct Impl; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:390:40: error: member access into incomplete type 'cv::utils::fs::FileLock::Impl' void FileLock::lock() { CV_Assert(pImpl->lock()); } ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/include/opencv2/core/utils/filesystem.private.hpp:55:12: note: forward declaration of 'cv::utils::fs::FileLock::Impl' struct Impl; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:391:42: error: member access into incomplete type 'cv::utils::fs::FileLock::Impl' void FileLock::unlock() { CV_Assert(pImpl->unlock()); } ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/include/opencv2/core/utils/filesystem.private.hpp:55:12: note: forward declaration of 'cv::utils::fs::FileLock::Impl' struct Impl; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:392:47: error: member access into incomplete type 'cv::utils::fs::FileLock::Impl' void FileLock::lock_shared() { CV_Assert(pImpl->lock_shared()); } ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/include/opencv2/core/utils/filesystem.private.hpp:55:12: note: forward declaration of 'cv::utils::fs::FileLock::Impl' struct Impl; ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cpp:393:49: error: member access into incomplete type 'cv::utils::fs::FileLock::Impl' void FileLock::unlock_shared() { CV_Assert(pImpl->unlock_shared()); } ^ /home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/include/opencv2/core/utils/filesystem.private.hpp:55:12: note: forward declaration of 'cv::utils::fs::FileLock::Impl' struct Impl; ^ 1 warning and 8 errors generated. *** Error code 1 Stop. make[2]: stopped in /home/ユーザ名/support/src/opencv/opencv-3.4.1/build *** Error code 1 Stop. make[1]: stopped in /home/ユーザ名/support/src/opencv/opencv-3.4.1/build *** Error code 1 Stop. make: stopped in /home/ユーザ名/support/src/opencv/opencv-3.4.1/build
###/home/ユーザ名/support/src/opencv/opencv-3.4.1/modules/core/src/utils/filesystem.cppの内容
107から142行目
#else struct stat stat_buf; return (0 == stat(path.c_str(), &stat_buf)); #endif } CV_EXPORTS void remove_all(const cv::String& path) { if (!exists(path)) return; if (isDirectory(path)) { std::vector<String> entries; utils::fs::glob(path, cv::String(), entries, false, true); for (size_t i = 0; i < entries.size(); i++) { const String& e = entries[i]; remove_all(e); } #ifdef _MSC_VER bool result = _rmdir(path.c_str()) == 0; #else bool result = rmdir(path.c_str()) == 0; #endif if (!result) { CV_LOG_ERROR(NULL, "Can't remove directory: " << path); } } else { #ifdef _MSC_VER bool result = _unlink(path.c_str()) == 0; #else bool result = unlink(path.c_str()) == 0; #endif
379から393行目
FileLock::FileLock(const char* fname) : pImpl(new Impl(fname)) { // nothing } FileLock::~FileLock() { delete pImpl; pImpl = NULL; } void FileLock::lock() { CV_Assert(pImpl->lock()); } void FileLock::unlock() { CV_Assert(pImpl->unlock()); } void FileLock::lock_shared() { CV_Assert(pImpl->lock_shared()); } void FileLock::unlock_shared() { CV_Assert(pImpl->unlock_shared()); }

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/04/09 01:45
2018/04/09 01:49
2018/04/09 02:49
2018/04/09 02:59
2018/04/09 03:03