• <bdo id='cJR6N'></bdo><ul id='cJR6N'></ul>
  • <tfoot id='cJR6N'></tfoot>

      <legend id='cJR6N'><style id='cJR6N'><dir id='cJR6N'><q id='cJR6N'></q></dir></style></legend>

        <small id='cJR6N'></small><noframes id='cJR6N'>

      1. <i id='cJR6N'><tr id='cJR6N'><dt id='cJR6N'><q id='cJR6N'><span id='cJR6N'><b id='cJR6N'><form id='cJR6N'><ins id='cJR6N'></ins><ul id='cJR6N'></ul><sub id='cJR6N'></sub></form><legend id='cJR6N'></legend><bdo id='cJR6N'><pre id='cJR6N'><center id='cJR6N'></center></pre></bdo></b><th id='cJR6N'></th></span></q></dt></tr></i><div id='cJR6N'><tfoot id='cJR6N'></tfoot><dl id='cJR6N'><fieldset id='cJR6N'></fieldset></dl></div>
      2. 构建 OpenCV 时出现 CMake 错误 - CMakeLists 不匹配

        时间:2023-12-03

        <tfoot id='6f9hW'></tfoot>
          • <bdo id='6f9hW'></bdo><ul id='6f9hW'></ul>
            <legend id='6f9hW'><style id='6f9hW'><dir id='6f9hW'><q id='6f9hW'></q></dir></style></legend>
                <tbody id='6f9hW'></tbody>
              <i id='6f9hW'><tr id='6f9hW'><dt id='6f9hW'><q id='6f9hW'><span id='6f9hW'><b id='6f9hW'><form id='6f9hW'><ins id='6f9hW'></ins><ul id='6f9hW'></ul><sub id='6f9hW'></sub></form><legend id='6f9hW'></legend><bdo id='6f9hW'><pre id='6f9hW'><center id='6f9hW'></center></pre></bdo></b><th id='6f9hW'></th></span></q></dt></tr></i><div id='6f9hW'><tfoot id='6f9hW'></tfoot><dl id='6f9hW'><fieldset id='6f9hW'></fieldset></dl></div>

                <small id='6f9hW'></small><noframes id='6f9hW'>

                • 本文介绍了构建 OpenCV 时出现 CMake 错误 - CMakeLists 不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我尝试在我的 Raspberry Pi 2B 上构建 OpenCV 3.1.0.不幸的是,当我尝试时:

                  I tried to build OpenCV 3.1.0 on my Raspberry Pi 2B. Unfortunetly, when I trying:

                  cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF/home/pi/Downloads/opencv-3.1.0

                  cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF /home/pi/Downloads/opencv-3.1.0

                  它给了我一个错误:(:

                  It gave me a error :( :

                  CMake 错误:源/home/pi/Downloads/opencv-3.1.0/CMakeLists.txt"与源/home/pi/Downloads/opencv-3.1.0/modules/CMakeLists.txt"不匹配" 用于生成缓存.使用不同的源目录重新运行 cmake.

                  CMake Error: The source "/home/pi/Downloads/opencv-3.1.0/CMakeLists.txt" does not match the source "/home/pi/Downloads/opencv-3.1.0/modules/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.

                  我想将 OpenCV 与我已经安装的 C++ 和 Code::Bocks 一起使用.我在互联网上找不到任何解决方案,所以如果 smb 帮助我,我会很高兴.:) 忘了说我用的是 Raspbian Jezzy.

                  I want to use OpenCV with C++ and Code::Bocks, which I have already installed. I can't found any solution on internet, so I will be very happy if smb help me. :) Forgot to say I using Raspbian Jezzy.

                  推荐答案

                  首先,我希望您在单独的目录中外部源代码中运行 CMake.不建议这样做

                  First, I hope you do run CMake outside your sources, in a separate directory. Not doing that is really not recommended

                  要了解错误消息,您必须对 CMake 的工作原理有所了解.

                  To understand the error message you have to know a little bit on how CMake works.

                  基本上,当你跑步时

                  cd /path/to/opencv
                  mkdir build
                  cd build
                  cmake ..
                  

                  CMake 在构建目录中生成缓存(这是一个名为 CMakeCache.txt 的简单文件).该文件包含一些信息,例如:

                  CMake generates a cache in the build dir (It's a simple file named CMakeCache.txt). This file contains some information like:

                  • 源路径/path/to/opencv
                  • 构建目录的路径/path/to/opencv/build
                  • 使用的 CMake 生成器(Ninja、Unix Makefiles ...)

                  如果您重新运行 CMake 并更改这些值之一(通过使用不同参数重新运行 cmake、设置其他生成器或移动文件),CMake 会抱怨此类消息.

                  If you ever re-run CMake and change one of these values, (by re-running cmake with different arguments, setting an other generotor or moving files), CMake will complain with this kind of message.

                  一个好的解决方案是删除 CMakeCache,甚至整个构建目录以确保安全.

                  A good solution is then to delete the CMakeCache, or even the whole build dir to be safe.

                  这篇关于构建 OpenCV 时出现 CMake 错误 - CMakeLists 不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:{Makefile 错误}“命令在第一个目标之前开始.停下." 下一篇:树莓派的交叉编译

                  相关文章

                • <i id='GCiIQ'><tr id='GCiIQ'><dt id='GCiIQ'><q id='GCiIQ'><span id='GCiIQ'><b id='GCiIQ'><form id='GCiIQ'><ins id='GCiIQ'></ins><ul id='GCiIQ'></ul><sub id='GCiIQ'></sub></form><legend id='GCiIQ'></legend><bdo id='GCiIQ'><pre id='GCiIQ'><center id='GCiIQ'></center></pre></bdo></b><th id='GCiIQ'></th></span></q></dt></tr></i><div id='GCiIQ'><tfoot id='GCiIQ'></tfoot><dl id='GCiIQ'><fieldset id='GCiIQ'></fieldset></dl></div>
                  <legend id='GCiIQ'><style id='GCiIQ'><dir id='GCiIQ'><q id='GCiIQ'></q></dir></style></legend>
                  • <bdo id='GCiIQ'></bdo><ul id='GCiIQ'></ul>

                  1. <small id='GCiIQ'></small><noframes id='GCiIQ'>

                    1. <tfoot id='GCiIQ'></tfoot>