Ask Your Question
0

I can not build OpenCV3.4.1 on FreeBSD11.1.

asked 2018-04-11 10:34:57 -0600

sikkoku20 gravatar image

An error occurred when trying to build OpenCV 3.4.1 with the make command. How do I build successfully?

/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 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2018-11-22 08:39:50 -0600

bram gravatar image

A quick remark for anyone else running into the same errors while compiling OpenCV on FreeBSD: The issue has been resolved with this commit.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-04-11 10:34:57 -0600

Seen: 240 times

Last updated: Apr 11 '18