ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • MinGW + Visual Studio Code에서 OpenCV 사용하는 방법
    OpenCV/Windows개발 환경&라이브러리 빌드 2019.11.05 23:43

     

     

    Visual Studio Code에서 OpenCV 코드를 컴파일하기 위해 필요한 준비를 소개합니다.

     

     

     

     

    1.

    MinGW + Sublime Text 3에서 OpenCV 사용하는 방법

     

    2.

    main.cpp

    #include "opencv2/opencv.hpp"
    #include <iostream>  
      
    using namespace cv;  
    using namespace std;  
      
      
      
    int main(int, char**)  
    {  
    
        VideoCapture cap(0);  
        if (!cap.isOpened())  
        {  
            printf("카메라를 열수 없습니다. \n");  
        }  
      
      
        Mat frame;  
        namedWindow("camera1", 1);  
       
      
        for (;;)  
        {  
      
            cap >> frame;  
      
            imshow("camera1", frame);  
      
            if (waitKey(20) >= 0) break;  
        }  
      
      
        return 0;  
    }  

     

     

    3.

    CMakeLists.txt

    cmake_minimum_required(VERSION 2.8)
    
    set(pathOPENCV C:/opencv-mingw/build)
    include_directories(${pathOPENCV}/include)
    set(LIBOPENCV ${pathOPENCV}/x64/mingw/lib/libopencv_world410.dll.a)
    
    get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME)
    string(REPLACE " " "_" ProjectId ${ProjectId})
    project(${ProjectId} C CXX)
    
    set (CMAKE_CXX_STANDARD 11)
    
    file(GLOB SOURCES  *.cpp)
     
    add_executable(${PROJECT_NAME} ${SOURCES} )
    target_link_libraries( ${PROJECT_NAME} ${LIBOPENCV} )

     

     

    4.

    tasks.json

    {
        "version": "2.0.0",
        "runner": "terminal",
        "type": "shell",
        "echoCommand": true,
        "presentation" : { "reveal": "always" },
        "tasks": [
              //C++ 컴파일
              {
                "label": "compile for C++",
                "command": "cd ${fileDirname} && cmake . -G \"MinGW Makefiles\" && mingw32-make",
                "group": "build",
    
                //컴파일시 에러를 편집기에 반영
                //참고:   https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher
    
                "problemMatcher": {
                    "fileLocation": [
                        "relative",
                        "${workspaceRoot}"
                    ],
                    "pattern": {
                        // The regular expression. 
                       //Example to match: helloWorld.c:5:3: warning: implicit declaration of function 'prinft'
                        "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",
                        "file": 1,
                        "line": 2,
                        "column": 3,
                        "severity": 4,
                        "message": 5
                    }
                }
            },
            // 바이너리 실행(Windows)
            {
                "label": "execute",
                "command": "cmd",
                "group": "test",
                "args": [
                    "/C", "${fileDirname}\\${workspaceFolderBasename}"
                ]
            }
        ]
    }

     

     

    5.

    // 키 바인딩을 이 파일에 넣어서 기본값을 덮어씁니다.
    [
        //컴파일
        { "key": "ctrl+alt+c", "command": "workbench.action.tasks.build" },
        
        //실행
        { "key": "ctrl+alt+r", "command": "workbench.action.tasks.test" }
    ]

     

     

    예제 컴파일 진행시 다음과 같은 오류가 보인다면..

     

    '&&' 토큰은 이 버전에서 올바른 문 구분 기호가 아닙니다.

     

    Ctrl + Shift + P를 누른 후, shell 입력 하고 터미널 : 기본 쉘 선택을 클릭하세요. 

     

     

    Command Prompt를 클릭하세요. 

    포스트 작성시에는 문제 없었지만 이후 문제가 생길 수 있습니다.
    댓글로 알려주시면 빠른 시일내에 답변을 드리겠습니다.

    여러분의 응원으로 좋은 컨텐츠가 만들어집니다. 지금 본 내용이 도움이 되었다면 후원 또는 유튜브 구독 부탁드립니다. 감사합니다 : )

    유튜브 구 독 하 기
    후 원 하 기


    댓글 24

    • 2019.08.13 11:53


      비밀댓글입니다

      • Favicon of https://webnautes.tistory.com BlogIcon webnautes 2019.08.13 14:28 신고


        사용한 컴파일러 버전이 영상과 다른가요?

        찾아보니 다음 두 옵션을 비활성화하면 해결된다고 합니다. cmake 시 다음 옵션 뒤에 추가해주면 됩니다

        WITH_IPP=OFF, WITH_MSMF=OFF


        참고한곳
        https://answers.opencv.org/question/192758/compile-error-when-compiling-for-windows-341-dev/

    • hong 2019.08.13 15:51


      안녕하세요. 항상 감사하게 도움을 받고 있습니다.
      WITH_IPP, WITH_MSMF를 OFF되어진 상태임에도 불구하고,
      C:\OpenCV\sources\opencv-4.1.0\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc: In function 'FILE* google::protobuf::internal::win32::fopen(const char*, const char*)':
      C:\OpenCV\sources\opencv-4.1.0\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:330:10: error: '::_wfopen' has not been declared
      return ::_wfopen(wpath.c_str(), wmode.c_str());
      ^~
      3rdparty\protobuf\CMakeFiles\libprotobuf.dir\build.make:258: recipe for target '3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj' failed
      mingw32-make[2]: *** [3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj] Error 1
      CMakeFiles\Makefile2:598: recipe for target '3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all' failed
      mingw32-make[1]: *** [3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all] Error 2
      Makefile:161: recipe for target 'all' failed
      mingw32-make: *** [all] Error 2

      위와 같은 에러가 발생하는데 원인을 잘 모르겠습니다.

      • Favicon of https://webnautes.tistory.com BlogIcon webnautes 2019.08.13 15:59 신고


        다시 찾아보니.. 다음 두 옵션을 넣어보랍니다.

        -D BUILD_PROTOBUF=OFF -D BUILD_opencv_dnn=OFF

        https://github.com/opencv/opencv/issues/7933


        이런 쪽 에러는 고쳐질때까지 구글에서 검색해서 해보는 수 밖에 없는 듯합니다.

    • 파이썬! 2019.09.19 20:59


      안녕하세요 제가 파이썬으로 opencv 사용 하려는건데 이 포스팅의 방식대로 해도 python에서 사용이 가능한가요?

      • Favicon of https://webnautes.tistory.com BlogIcon webnautes 2019.09.19 21:02 신고


        아래 링크에 있는 영상을 참고하세요. pip로 다음처럼 opencv만 따로 설치해주면 됩니다.
        pip install opencv-contrib-python

        https://webnautes.tistory.com/1369

    • 으악! 2019.10.17 15:39


      vs코드로 opencv를 하려는데요 opencv.org사이트에서 4.1.0 윈도우 exe파일로 깔으신건가요?

      • Favicon of https://webnautes.tistory.com BlogIcon webnautes 2019.10.17 16:09 신고


        포스트 1번에 나온 영상을 참고하여 MINGW를 사용하여 OpenCV를 빌드해야 합니다.

        Visual Studio에 비해 SubLime TEXT나 VSCODE가 가벼워서 사용하기 편합니다.

    • 으악! 2019.10.20 20:48


      형님 몇몇 파일이 filed 가 뜨는데 정상인가요?
      최종 파일까지 다 만들었는데 컴파일이 안되서요

    • 으악! 2019.10.20 22:24


      아 잘못적었어요 failed입니다 ㅜ

    • 으악! 2019.11.05 09:25


      AVX_512F is not supported by C++ compiler
      AVX512_SKX is not supported by C++ compiler
      Dispatch optimization AVX512_SKX is not available, skipped
      libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.1.0-libjpeg-turbo
      Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
      Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
      Could NOT find BLAS (missing: BLAS_LIBRARIES)
      LAPACK requires BLAS
      A library with LAPACK API not found. Please specify library location.
      VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
      OpenCV Python: during development append to PYTHONPATH: C:/opencv-sources/build/python_loader
      Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
      CMake Error at modules/videoio/cmake/detect_ffmpeg.cmake:16 (include):
      include could not find load file:

      C:/opencv-sources/build/3rdparty/ffmpeg/ffmpeg_version.cmake
      Call Stack (most recent call first):
      modules/videoio/cmake/init.cmake:3 (include)
      modules/videoio/cmake/init.cmake:24 (add_backend)
      cmake/OpenCVModule.cmake:312 (include)
      cmake/OpenCVModule.cmake:375 (_add_modules_1)
      modules/CMakeLists.txt:7 (ocv_glob_modules)


      Excluding from source files list: modules/imgproc/src/sumpixels.avx512_skx.cpp
      Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
      Error copying file (if different) from "
      C:/opencv-sources/build/3rdparty/ffmpeg/opencv_ffmpeg_64.dll" to "C:/opencv-sources/build/bin/opencv_ffmpeg410_64.dll".

      CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
      CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
      directory
      Call Stack (most recent call first):
      CMakeLists.txt:1066 (include)



      General configuration for OpenCV 4.1.0 =====================================
      Version control: unknown

      Platform:
      Timestamp: 2019-11-05T00:23:39Z
      Host: Windows 10.0.18362 AMD64
      CMake: 3.15.4
      CMake generator: MinGW Makefiles
      CMake build tool: C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/bin/mingw32-make.exe
      Configuration: Release

      CPU/HW features:
      Baseline: SSE SSE2 SSE3
      requested: SSE3
      Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2
      requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (15 files): + SSSE3 SSE4_1
      SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (29 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

      C/C++:
      Built as dynamic libs?: YES
      C++ Compiler: C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe (ver 8.1.0)
      C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
      C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
      C Compiler: C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe
      C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
      C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
      Linker flags (Release): -Wl,--gc-sections
      Linker flags (Debug): -Wl,--gc-sections
      ccache: NO
      Precompiled headers: YES
      Extra dependencies:
      3rdparty dependencies:

      OpenCV modules:
      To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo stitching ts video videoio
      Disabled: world
      Disabled by dependency: -
      Unavailable: java js python2 python3
      Applications: tests perf_tests apps
      Documentation: NO
      Non-free algorithms: NO

      Windows RT support: NO

      GUI:
      Win32 UI: YES
      VTK support: NO

      Media I/O:
      ZLib: build (ver 1.2.11)
      JPEG: build-libjpeg-turbo (ver 2.0.2-62)
      WEBP: build (ver encoder: 0x020e)
      PNG: build (ver 1.6.36)
      TIFF: build (ver 42 - 4.0.10)
      JPEG 2000: build (ver 1.900.1)
      OpenEXR: build (ver 1.7.1)
      HDR: YES
      SUNRASTER: YES
      PXM: YES
      PFM: YES

      Video I/O:
      DC1394: NO
      FFMPEG: YES (prebuilt binaries)
      avcodec: NO
      avformat: NO
      avutil: NO
      swscale: NO
      avresample: NO
      GStreamer: NO
      DirectShow: YES

      Parallel framework: none

      Trace: YES (built-in)

      Other third-party libraries:
      Lapack: NO
      Eigen: NO
      Custom HAL: NO
      Protobuf: build (3.5.1)

      OpenCL: YES (NVD3D11)
      Include path: C:/opencv-sources/opencv-4.1.0/3rdparty/include/opencl/1.2
      Link libraries: Dynamic load

      Python (for build): NO

      Java:
      ant: NO
      JNI: C:/Program Files/Java/jdk1.8.0_60/include C:/Program Files/Java/jdk1.8.0_60/include/win32 C:/Program Files/Java/jdk1.8.0_60/include
      Java wrappers: NO
      Java tests: NO

      Install to: C:/opencv-sources/build/install
      -----------------------------------------------------------------

      Configuring incomplete, errors occurred!
      See also "C:/opencv-sources/build/CMakeFiles/CMakeOutput.log".

      에러메세지로는
      Error in configuration process, project files may be invalid가 듭니다.

      • 으악! 2019.11.05 15:20


        해결했습니다.
        파이썬 2.7을 AppDataLocalProgramsPythonPython27 에 설치하고 환경변수 까지 잡아주고

        생성할 파일 목록에 WITH_OPENCL_D3D11_NV 체크 해제하니까 컴파일 제너레이터까지 됬습니다.

      • Favicon of https://webnautes.tistory.com BlogIcon webnautes 2019.11.05 19:33 신고


        다행입니다

    • 도와줘요 천천히! 진짜 천천히는 말고요 ㅠㅠㅠ 2019.11.05 16:24


      안녕하세요 포스터 보고 컴파일단계까지 왔습니다.
      task.json파일 command 명령 부분에서
      > Executing task: cd e:\code_CnCPP && cmake . -G "MinGW Makefiles" && mingw32-make <


      위치 줄:1 문자:18
      + cd e:\code_CnCPP && cmake . -G MinGW Makefiles && mingw32-make
      + ~~
      '&&' 토큰은 이 버전에서 올바른 문 구분 기호가 아닙니다.
      위치 줄:1 문자:48
      + cd e:\code_CnCPP && cmake . -G MinGW Makefiles && mingw32-make
      + ~~
      '&&' 토큰은 이 버전에서 올바른 문 구분 기호가 아닙니다.
      + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
      + FullyQualifiedErrorId : InvalidEndOfLine

      터미널 프로세스가 종료 코드 1(으)로 종료되었습니다.

      터미널이 작업에서 다시 사용됩니다. 닫으려면 아무 키나 누르세요.
      =========================================
      떠서 &&부분을 바꿔보니까

      > Executing task: cd e:\code_CnCPP ; cmake ${fileName} -G "MinGW Makefiles" if ($?) { mingw32-make} <


      CMake Error: Could not create named generator MinGW

      Generators
      Visual Studio 16 2019 = Generates Visual Studio 2019 project files.
      Use -A option to specify architecture.
      Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
      Optional [arch] can be "Win64" or "ARM".
      Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
      Optional [arch] can be "Win64" or "ARM".
      Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
      Optional [arch] can be "Win64" or "ARM".
      Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
      Optional [arch] can be "Win64" or "ARM".
      Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
      Optional [arch] can be "Win64" or "IA64".
      Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
      Optional [arch] can be "Win64" or "IA64".
      Borland Makefiles = Generates Borland makefiles.
      * NMake Makefiles = Generates NMake makefiles.
      NMake Makefiles JOM = Generates JOM makefiles.
      MSYS Makefiles = Generates MSYS makefiles.
      MinGW Makefiles = Generates a make file for use with
      mingw32-make.
      Unix Makefiles = Generates standard UNIX makefiles.
      Green Hills MULTI = Generates Green Hills MULTI files
      (experimental, work-in-progress).
      Ninja = Generates build.ninja files.
      Watcom WMake = Generates Watcom WMake makefiles.
      CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files.
      CodeBlocks - NMake Makefiles = Generates CodeBlocks project files.
      CodeBlocks - NMake Makefiles JOM
      = Generates CodeBlocks project files.
      CodeBlocks - Ninja = Generates CodeBlocks project files.
      CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
      CodeLite - MinGW Makefiles = Generates CodeLite project files.
      CodeLite - NMake Makefiles = Generates CodeLite project files.
      CodeLite - Ninja = Generates CodeLite project files.
      CodeLite - Unix Makefiles = Generates CodeLite project files.
      Sublime Text 2 - MinGW Makefiles
      = Generates Sublime Text 2 project files.
      Sublime Text 2 - NMake Makefiles
      = Generates Sublime Text 2 project files.
      Sublime Text 2 - Ninja = Generates Sublime Text 2 project files.
      Sublime Text 2 - Unix Makefiles
      = Generates Sublime Text 2 project files.
      Kate - MinGW Makefiles = Generates Kate project files.
      Kate - NMake Makefiles = Generates Kate project files.
      Kate - Ninja = Generates Kate project files.
      Kate - Unix Makefiles = Generates Kate project files.
      Eclipse CDT4 - NMake Makefiles
      = Generates Eclipse CDT 4.0 project files.
      Eclipse CDT4 - MinGW Makefiles
      = Generates Eclipse CDT 4.0 project files.
      Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
      Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

      터미널 프로세스가 종료 코드 1(으)로 종료되었습니다.

      터미널이 작업에서 다시 사용됩니다. 닫으려면 아무 키나 누르세요.
      ====================================
      generator MinGW 생성 오류가 나오는데 아무리 찾아봐도 커맨드를 어떻게 수정해야 할지 모르겠습니다ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ
      vscode version 1.39.2
      gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
      cmake version 3.15.4

    • 도와줘요 천천히! 진짜 천천히는 말고요 ㅠㅠㅠ 2019.11.05 21:25


      따로따로 실행해봐도
      CMake Error: Could not create named generator MinGW
      Generators
      Visual Studio 16 2019 = Generates Visual Studio 2019 project files.
      Use -A option to specify architecture.
      Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
      Optional [arch] can be "Win64" or "ARM".
      Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
      Optional [arch] can be "Win64" or "ARM".
      Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
      Optional [arch] can be "Win64" or "ARM".
      Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
      Optional [arch] can be "Win64" or "ARM".
      Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
      Optional [arch] can be "Win64" or "IA64".
      Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
      Optional [arch] can be "Win64" or "IA64".
      Borland Makefiles = Generates Borland makefiles.
      * NMake Makefiles = Generates NMake makefiles.
      NMake Makefiles JOM = Generates JOM makefiles.
      MSYS Makefiles = Generates MSYS makefiles.
      MinGW Makefiles = Generates a make file for use with
      mingw32-make.
      Unix Makefiles = Generates standard UNIX makefiles.
      Green Hills MULTI = Generates Green Hills MULTI files
      (experimental, work-in-progress).
      Ninja = Generates build.ninja files.
      Watcom WMake = Generates Watcom WMake makefiles.
      CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files.
      CodeBlocks - NMake Makefiles = Generates CodeBlocks project files.
      CodeBlocks - NMake Makefiles JOM
      = Generates CodeBlocks project files.
      CodeBlocks - Ninja = Generates CodeBlocks project files.
      CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
      CodeLite - MinGW Makefiles = Generates CodeLite project files.
      CodeLite - NMake Makefiles = Generates CodeLite project files.
      CodeLite - Ninja = Generates CodeLite project files.
      CodeLite - Unix Makefiles = Generates CodeLite project files.
      Sublime Text 2 - MinGW Makefiles
      = Generates Sublime Text 2 project files.
      Sublime Text 2 - NMake Makefiles
      = Generates Sublime Text 2 project files.
      Sublime Text 2 - Ninja = Generates Sublime Text 2 project files.
      Sublime Text 2 - Unix Makefiles
      = Generates Sublime Text 2 project files.
      Kate - Ninja = Generates Kate project files.
      Kate - Unix Makefiles = Generates Kate project files.
      Eclipse CDT4 - NMake Makefiles
      = Generates Eclipse CDT 4.0 project files.
      Eclipse CDT4 - MinGW Makefiles
      = Generates Eclipse CDT 4.0 project files.
      Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
      Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

      명령어도
      PS E:\code_CnCPP> cmake .\main.cpp -g MinGW Makefiles
      PS E:\code_CnCPP> cmake .\main.cpp -g "MinGW Makefiles"
      PS E:\code_CnCPP> cmake .\main.cpp -g "MinGW Makefiles\"
      이렇게 바꿔서 해도 안됩니다 ㅠㅠㅠㅠㅠㅠㅠ


      PS E:\code_CnCPP> cmake .\main.cpp -G \"MinGW Makefiles\"
      CMake Error: Could not create named generator \MinGW Makefiles"
      이렇게 치면 제너레이터 목록 쭈루루루룩 뜨고요 근데 그중에
      * NMake Makefiles = Generates NMake makefiles. 얘만 앞에 *표가 있네요? 뭐가 잘못된걸까요

      • 도와줘요 천천히! 진짜 천천히는 말고요 ㅠㅠㅠ 2019.11.05 22:03


        별표난거 컴파일 해보니 별 도움없이 이렇게 뜨네요 ㅠ
        PS E:\code_CnCPP> cmake . -g "NMake Makefiles"
        CMake Error: The source directory "E:/code_CnCPP/NMake Makefiles" does not exist.
        Specify --help for usage, or press the help button on the CMake GUI.

      • Favicon of https://webnautes.tistory.com BlogIcon webnautes 2019.11.05 23:44 신고


        윈도우에서 디폴트 쉘이 파워셀로 바뀌어서 문제였네요..

        포스트 마지막에 적어놓은대로 진행하고 다시 해보세요.

    • 도와줘요 천천히! 진짜 천천히는 말고요 ㅠㅠㅠ 2019.11.06 10:09


      감사합니다 쎈쎄 드디어 개발환경을 바꿨씁니다 쎈세 기프트콘 드리고싶은데 방법 없습니까 쎈세?

    • 쇠질 2019.11.19 16:47


      libopencv_world410.dll 파일을 main.cpp폴더로 옮겼는데도 execute 즉, Run이 안됩니다.
      터미널에서는

      컴파일시 :

      > Executing task: cd c:\wsp\vscodeWsp\SafesoftOpenCVgw && cmake . -G "MinGW Makefiles" && mingw32-make <

      'cmake'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는
      배치 파일이 아닙니다.
      터미널 프로세스가 종료 코드 1(으)로 종료되었습니다.

      터미널이 작업에서 다시 사용됩니다. 닫으려면 아무 키나 누르세요.

      excute시 :


      'c:\wsp\vscodeWsp\SafesoftOpenCVgw\wsp'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그
      램, 또는
      배치 파일이 아닙니다.
      터미널 프로세스가 종료 코드 1(으)로 종료되었습니다.

      터미널이 작업에서 다시 사용됩니다. 닫으려면 아무 키나 누르세요.

      이렇게 뜨는데 실행이 안됩니다. 도와주세요

Designed by Tistory.