Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,按照你所述的readme中的步骤仍然有问题,应该如何解决 #7

Open
GandalfLiu opened this issue May 15, 2020 · 1 comment

Comments

@GandalfLiu
Copy link

GandalfLiu commented May 15, 2020

系统:ubuntu16.04.1LTS
执行cmake命令

cmake -D CMAKE_BUILD_TYPE=RELEASE \
     -D CMAKE_INSTALL_PREFIX=/home/ubuntu/anaconda3/envs/ocr  \
    -D BUILD_opencv_python2=OFF \
    -D BUILD_opencv_python3=ON  \
   -D PYTHON3_EXECUTABLE=/home/ubuntu/anaconda3/envs/ocr/bin/python3.6 \
  -D PYTHON3_INCLUDE_PATH=/usr/include/python3.6m  \
-D PYTHON3_LIBRARIES=/home/ubuntu/anaconda3/envs/ocr/lib/libpython3.6m.so \
-D PYTHON_NUMPY_PATH=/home/anaconda3/envs/ocr/lib/python3.6/site-packages/numpy/core/include .. \
&& make -j2 && make install

报错提示:

CMake Error at CMakeLists.txt:18 (include):
  include could not find load file:

    cmake/OpenCVMinDepVersions.cmake


CMake Error at CMakeLists.txt:111 (include):
  include could not find load file:

    cmake/OpenCVUtils.cmake


CMake Error at CMakeLists.txt:112 (ocv_cmake_reset_hooks):
  Unknown CMake command "ocv_cmake_reset_hooks".

关于错误提示中的.cmake文件在cmake文件夹中都有,不知道为何仍然报错
执行命令所处的地址是:

/home/ubuntu/opencv-for-darknet/opencv-4.0.1

一开始执行上述cmake命令时还会报缺少CMakeLists.txt

CMake Error: The source directory "/home/ubuntu/opencv-for-darknet" does not appear to contain CMakeLists.txt

于是我将opencv-4.0.1中的CMakeLists.txt复制到了/home/ubuntu/opencv-for-darknet中

请问应该如何解决呢

@GandalfLiu
Copy link
Author

错误已经解决, 已经重新从零开始编译, 另外, 用ubuntu的记得cmake之前加上

mkdir build && cd build

作者没写这个,加上我也没看mac的命令导致我被坑了好久
另外,贴上自己的cmake指令

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/home/ubuntu/anaconda3/envs/ocr \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D PYTHON3_EXECUTABLE=/home/ubuntu/anaconda3/envs/ocr/bin/python3.6 \
-D PYTHON3_INCLUDE_PATH=/home/ubuntu/anaconda3/envs/ocr/include/python3.6m \
-D PYTHON3_LIBRARIES=/home/ubuntu/anaconda3/envs/ocr/lib/libpython3.6m.so \
-D PYTHON3_NUMPY_INCLUDE_DIRS=/home/ubuntu/anaconda3/envs/ocr/lib/python3.6/site-packages/numpy/core/include .. \
&& make -j2 && sudo make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant