質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
CMake

CMakeはクロスプラットフォームで作動するオープンソースのビルドシステムです。コマンドライン又は組み込まれた開発環境で使うことができる元のmakefileとプロジェクトファイルを生成します。

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

OpenCV

OpenCV(オープンソースコンピュータービジョン)は、1999年にインテルが開発・公開したオープンソースのコンピュータビジョン向けのクロスプラットフォームライブラリです。

Q&A

解決済

1回答

2449閲覧

OpenCVをCMakeでビルドしようとしてエラー

Miakge32

総合スコア1

CMake

CMakeはクロスプラットフォームで作動するオープンソースのビルドシステムです。コマンドライン又は組み込まれた開発環境で使うことができる元のmakefileとプロジェクトファイルを生成します。

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

OpenCV

OpenCV(オープンソースコンピュータービジョン)は、1999年にインテルが開発・公開したオープンソースのコンピュータビジョン向けのクロスプラットフォームライブラリです。

0グッド

0クリップ

投稿2022/10/17 12:29

前提

OS: Windows10
CMake: 3.25.0
Visual Studio: VS2022 17.3.6

OpenCV: 4.6.0をgithubからダウンロード

実現したいこと

OpenCV+OpenCV contrib4.6.0を使うためにビルドしようとしているのですが、CMakeでOpenCVのソースからConfigureしようとした段階でエラーを吐かれてしまっています。
試しに無視してビルドしてみようとしましたが失敗しました。
手順は下記サイトに従って行っています。
https://swallow-incubate.com/archives/blog/20200508/

発生している問題・エラーメッセージ

赤字部分を抜粋

CMake Warning at cmake/OpenCVDetectPython.cmake:81 (message): CMake's 'find_host_package(PythonInterp 2.7)' found wrong Python version: PYTHON_EXECUTABLE=C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe PYTHON_VERSION_STRING=3.6.6 Consider providing the 'PYTHON2_EXECUTABLE' variable via CMake command line or environment variables Call Stack (most recent call first): cmake/OpenCVDetectPython.cmake:271 (find_python) CMakeLists.txt:628 (include)
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_SIZE_T.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-3y1slf/Debug/cmTC_1555a.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libjpeg-turbo/CMakeLists.txt:25 (check_type_size) Check size of unsigned long CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_UNSIGNED_LONG.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-6ypp64/Debug/cmTC_725b5.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libjpeg-turbo/CMakeLists.txt:26 (check_type_size)
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_SIGNED_SHORT.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-1obyr6/Debug/cmTC_6cdc3.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:64 (check_type_size) Check size of unsigned short CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_UNSIGNED_SHORT.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-y2c7ru/Debug/cmTC_15d3d.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:65 (check_type_size) Check size of signed int CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_SIGNED_INT.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-poowga/Debug/cmTC_072a9.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:66 (check_type_size) Check size of unsigned int CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_UNSIGNED_INT.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-qz38r9/Debug/cmTC_767f4.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:67 (check_type_size) Check size of signed long CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_SIGNED_LONG.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-dgxtdh/Debug/cmTC_93b24.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:68 (check_type_size) Check size of signed long long CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_SIGNED_LONG_LONG.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-uv78e1/Debug/cmTC_392a7.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:70 (check_type_size) Check size of unsigned long long CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_UNSIGNED_LONG_LONG.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-5u3zyt/Debug/cmTC_161d3.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:71 (check_type_size) Check size of unsigned char * CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_UNSIGNED_CHAR_P.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-3c3ti9/Debug/cmTC_17c5f.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:72 (check_type_size) Check size of ptrdiff_t CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/CheckTypeSize/SIZEOF_PTRDIFF_T.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-nqfqw3/Debug/cmTC_82f6f.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl) 3rdparty/libtiff/CMakeLists.txt:77 (check_type_size)
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindOpenMP.cmake:420 (try_compile): Cannot copy output executable '' to destination specified by COPY_FILE: 'D:/source/opencv-4.6.0/build/CMakeFiles/FindOpenMP/ompver_C.bin' Recorded try_compile output location doesn't exist: D:/source/opencv-4.6.0/build/CMakeFiles/CMakeScratch/TryCompile-qgdw3w/Debug/cmTC_f90ba.exe Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.25/Modules/FindOpenMP.cmake:560 (_OPENMP_GET_SPEC_DATE) C:/Program Files/CMake/share/cmake-3.25/Modules/FindBLAS.cmake:768 (find_package) C:/Program Files/CMake/share/cmake-3.25/Modules/FindLAPACK.cmake:247 (find_package) C:/Program Files/CMake/share/cmake-3.25/Modules/FindLAPACK.cmake:283 (_lapack_find_dependency) cmake/OpenCVFindLAPACK.cmake:176 (find_package) CMakeLists.txt:734 (include)

小一時間調べてみましたが解決せず。なにか分かりましたら教えていただきたいです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

CMakeのバージョンの問題(間違ってpre release版をインストールしていました。)だったようで一つ古いバージョンのものに変えると解決しました

投稿2022/10/18 07:08

Miakge32

総合スコア1

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問