您好,登錄后才能下訂單哦!
win10下cmake編譯opencv庫(kù)問(wèn)題
CMake Error at platforms/android/android.toolchain.cmake:451 (message):
Could not find neither Android NDK nor Android standalone toolchain.
根據(jù)提示配置ANDROID_NDK到環(huán)境變量PATH中,即可
例如:ANDROID_NDK = D:\android-ndk-r14b
發(fā)現(xiàn)這個(gè)問(wèn)題時(shí),先是使用Android Studio中鏈接下載的最新ndk目錄(版本是17)。會(huì)報(bào)錯(cuò)
之后,從https://developer.android.google.cn/ndk/downloads/ 中下載最新的16b,還是報(bào)錯(cuò)。
最后 查看源碼文件夾下opencv-3.2.0\platforms\android\android.toolchain.cmake文件里有兩行注釋
Android CMake toolchain file, for use with the Android NDK r5-r10d
Requires cmake 2.6.3 or newer (2.8.9 or newer is recommended).
提示使用r5到r10版本的NDK(我去網(wǎng)上下只剩r10e的,下載來(lái)編譯后就可以通過(guò)了。)
CMake Error at D:/opencv/opencv-3.2.0/cmake/OpenCVUtils.cmake:1043 (file):
file DOWNLOAD HASH mismatch
for file: [D:/opencv/opencv_contrib-3.2.0/modules/dnn/.download/bd5e3eed635a8d32e2b99658633815ef/v3.1.0/protobuf-cpp-3.1.0.tar.gz]
expected hash: [bd5e3eed635a8d32e2b99658633815ef]
actual hash: [d41d8cd98f00b204e9800998ecf8427e]
status: [28;"Timeout was reached"]
Call Stack (most recent call first):
D:/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:23 (ocv_download)
D:/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:51 (ocv_protobuf_download)
D:/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:30 (include)
D:/opencv/opencv_contrib-3.2.0/modules/dnn/CMakeLists.txt:35 (include)
根據(jù)提示D:/opencv/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:23
找到該行信息
可以看出,他需要libprotobuf這個(gè)庫(kù),并且需要下載到 ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/protobuf/sources 目錄下,而下載地址就是 https://github.com/google/protobuf/releases ,于是我們只要手動(dòng)下載3.1.0,然后把文件放到這個(gè)目錄下即可。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。