cmake rebuild
时间: 2023-10-15 19:06:06 浏览: 53
cmake rebuild_cache是一个命令,通过调用CMake为源文件生成依赖关系(如果有的话)。这个命令会重新构建缓存,可以在需要重新配置项目时使用。它会重新扫描源文件并更新相关的构建配置信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Cmake第一课——如何使用](https://blog.csdn.net/denglin12315/article/details/119335646)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
相关问题
this algorithm is patented and is excluded in this configuration; set opencv_enable_nonfree cmake option and rebuild the library in function 'cv::xfeatures2d::surf::create'
这个算法是受专利保护的,因此在这个配置中被排除了。请设置opencv_enable_nonfree cmake选项并重新构建库,以便在cv::xfeatures2d::surf::create函数中使用它。
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv_contrib\modules\xfeatures2d\src\surf.cpp:1028: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SURF::create'
您遇到的错误是由于使用的是不包含受专利保护的算法的 OpenCV 配置导致的。在默认情况下,OpenCV 不包含受专利保护的算法,例如 SURF。要解决此问题,您需要重新构建 OpenCV 库并启用 OPENCV_ENABLE_NONFREE CMake 选项。这将启用受专利保护的算法。请按照以下步骤操作:
1. 下载 OpenCV 源代码并解压缩。
2. 进入解压后的 OpenCV 目录。
3. 创建一个新的目录(例如 build)作为构建目录。
4. 在构建目录中运行 CMake 命令,启用 OPENCV_ENABLE_NONFREE 选项:
```
cmake -DOPENCV_ENABLE_NONFREE=ON ..
```
5. 运行 make 命令来构建 OpenCV 库:
```
make
```
6. 构建完成后,您可以将生成的库文件链接到您的项目中,并重新运行您的代码。
请注意,启用 OPENCV_ENABLE_NONFREE 选项可能需要满足一些法律和许可要求。在使用之前,请确保您了解并遵守适用的法律和许可协议。