久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='atZhj'></small><noframes id='atZhj'>

    <tfoot id='atZhj'></tfoot>

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

        在 VSCode 中使用 MSVS 編譯器構建 OpenCV 應用程序

        Build OpenCV application with MSVS compiler in VSCode(在 VSCode 中使用 MSVS 編譯器構建 OpenCV 應用程序)
          <tbody id='o6nvx'></tbody>
        • <bdo id='o6nvx'></bdo><ul id='o6nvx'></ul>
          • <i id='o6nvx'><tr id='o6nvx'><dt id='o6nvx'><q id='o6nvx'><span id='o6nvx'><b id='o6nvx'><form id='o6nvx'><ins id='o6nvx'></ins><ul id='o6nvx'></ul><sub id='o6nvx'></sub></form><legend id='o6nvx'></legend><bdo id='o6nvx'><pre id='o6nvx'><center id='o6nvx'></center></pre></bdo></b><th id='o6nvx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='o6nvx'><tfoot id='o6nvx'></tfoot><dl id='o6nvx'><fieldset id='o6nvx'></fieldset></dl></div>

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

              <tfoot id='o6nvx'></tfoot>
              1. <small id='o6nvx'></small><noframes id='o6nvx'>

                  本文介紹了在 VSCode 中使用 MSVS 編譯器構建 OpenCV 應用程序的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試在 VSCode 中構建我的 C++ 項目.但是,我遇到 OpenCV 的鏈接問題錯誤 LNK2001:未解析的外部符號".我已經構建了與 vcpkg 一起使用的所有庫.

                  I'm trying to build my C++ project in VSCode. However, I'm experiencing link issues with OpenCV "error LNK2001: unresolved external symbol". I've build all the libraries I use with vcpkg.

                  我使用這個 .bat 文件構建:

                  I build using this .bat file:

                  @echo off
                  if exist "C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCAuxiliaryBuildvcvarsall.bat" (
                      call "C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCAuxiliaryBuildvcvarsall.bat" x64
                  ) else (
                      call "C:Program Files (x86)Microsoft Visual Studio2019CommunityVCAuxiliaryBuildvcvarsall.bat" x64
                  )
                  set compilerflags=/Od /Zi /EHsc /std:c++latest /I include /I C:includesvcpkginstalledx64-windowsinclude
                  set linkerflags=/OUT:binmain.exe
                  cl.exe %compilerflags% src*.cpp /link %linkerflags% /LIBPATH:C:includesvcpkginstalledx64-windowslib
                  del bin*.ilk *.obj *.pdb
                  

                  我的 tasks.json 文件是:

                  My tasks.json file is:

                  {
                      "version": "2.0.0",
                      "tasks": [
                          {
                              "label": "Build C++ project",
                              "type": "shell",
                              "group": {
                                  "kind": "build",
                                  "isDefault": true
                              },
                              "command": ".\build.bat"
                          },
                          {
                              "label": "Build & run C++ project",
                              "type": "shell",
                              "group": {
                                  "kind": "test",
                                  "isDefault": true
                              },
                              "command": ".\build.bat && .\bin\main.exe"
                          }
                      ]
                  }
                  

                  我的launch.json文件是:

                  My launch.json file is:

                  {
                      "version": "0.2.0",
                      "configurations": [
                          {
                              "name": "C++ Debug (Windows)",
                              "type": "cppvsdbg",
                              "request": "launch",
                              "program": "${workspaceFolder}/bin/main.exe",
                              "preLaunchTask": "Build C++ project",
                              "args": [],
                              "stopAtEntry": false,
                              "cwd": "${workspaceFolder}",
                              "environment": [],
                              "externalConsole": true,
                          }
                      ]
                  }
                  

                  最后我的 settings.json 文件是:

                  and finally my settings.json file is:

                  {
                      "terminal.integrated.shell.windows": "cmd.exe"
                  }
                  

                  我似乎找不到任何關于如何使用 MSVS 編譯器將 vcpkg 庫與 VSCode 正確鏈接的文檔.我真的很感激一些幫助.

                  I can't seem to find any documentation on how to properly link vcpkg libraries with VSCode using the MSVS compiler. I would really appreciate some help.

                  推薦答案

                  我最近在 Windows 10 上安裝了 OpenCV 4.3.0 (64bits) 并且不得不配置一個工作區在 Visual Studio Code (VSC) 中構建一個簡單的應用程序.

                  I recently installed OpenCV 4.3.0 (64bits) on Windows 10 and had to configure a workspace in Visual Studio Code (VSC) to build a simple application.

                  以下配置使用 cl.exe 的 x64 版本,這是 Microsoft Visual Studio 2019(社區版)附帶的 C/C++ 編譯器來構建 OpenCV 應用程序.

                  The following configuration uses the x64 version of cl.exe, the C/C++ compiler that ships with Microsoft Visual Studio 2019 (Community Edition) to build the OpenCV application.

                  請注意在此 tasks.json 文件中定義的路徑,因為它們在您的系統中可能會有所不同:

                  Pay attention to the paths defined on this tasks.json file because they might be different in your system:

                  {
                      "version": "2.0.0",
                      "windows": {
                          "options": {
                              "shell": {
                                  "executable": "C:\WINDOWS\System32\cmd.exe",
                                  "args": [ "/d", "/c" ]
                              }
                          },
                          "isShellCommand": true,
                          "showOutput": "always",
                          "echoCommand": true,
                      },
                      "tasks": [
                          {
                              "label": "build_vs2019",
                              "type": "shell",    
                              "windows": {
                                  "command": "call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" && cl.exe",
                                  "args": [
                                      "/Zi",
                                      "/EHsc",
                                      "/Fe:",
                                      "${fileDirname}\${fileBasenameNoExtension}.exe",
                                      "${file}",
                                      "-I", "C:\opencv\build\include",
                                      "/link", "/libpath:C:\opencv\build\x64\vc15\lib", "opencv_world430.lib"
                                  ],              
                                  "problemMatcher": [ "$msCompile" ],
                              },
                              "group": {
                                  "kind": "build",
                                  "isDefault": true
                              }
                          },
                          {
                              "label": "run",
                              "type": "shell",
                              "dependsOn": [ "build_vs2019" ],
                              "windows": {
                                  "command": "${fileDirname}\${fileBasenameNoExtension}.exe",
                                  "args": [ "superDark.jpg" ],
                                  "options": {
                                      "env": {
                                          "PATH": "C:\opencv\build\x64\vc15\bin"
                                      }
                                  }
                              },  
                              "presentation": {               
                                  "reveal": "silent",
                                  "clear": true,
                                  "showReuseMessage": false,
                              }
                          }
                      ]
                  }
                  

                  必須使用此配置來替換工作區中的配置.嘗試運行任務時,它將為您提供兩個選項供您選擇:

                  This configuration must be used to replace the one in your workspace. It will give you two options to select from when attempting to run tasks:

                  • build_vs2019:將shell定義為cmd.exe并執行vcvars64.bat來設置環境變量和路徑,讓您使用 cl.exe 的 x64 版本.它還指定了構建基于 OpenCV 的應用程序所需的頭文件和所需的庫.此選項構建應用程序.

                  • build_vs2019: defines the shell as cmd.exe and executes vcvars64.bat to setup the environment variables and paths that let you use the x64 version of cl.exe. It also specifies the headers and required libraries to build an OpenCV-based application. This option builds the application.

                  run:取決于上一個任務的成功,在 cmd 行上運行 OpenCV 應用程序.它調整 PATH 環境變量以指向 OpenCV DLLs 目錄.此選項執行應用程序.

                  run: depends on the success of the previous task to run the OpenCV application on the cmd-line. It adjusts the PATH environment variable to point to OpenCV DLLs directory. This option executes the application.

                  這篇關于在 VSCode 中使用 MSVS 編譯器構建 OpenCV 應用程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)

                • <i id='Y7zKP'><tr id='Y7zKP'><dt id='Y7zKP'><q id='Y7zKP'><span id='Y7zKP'><b id='Y7zKP'><form id='Y7zKP'><ins id='Y7zKP'></ins><ul id='Y7zKP'></ul><sub id='Y7zKP'></sub></form><legend id='Y7zKP'></legend><bdo id='Y7zKP'><pre id='Y7zKP'><center id='Y7zKP'></center></pre></bdo></b><th id='Y7zKP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Y7zKP'><tfoot id='Y7zKP'></tfoot><dl id='Y7zKP'><fieldset id='Y7zKP'></fieldset></dl></div>
                    <bdo id='Y7zKP'></bdo><ul id='Y7zKP'></ul>
                            <tbody id='Y7zKP'></tbody>

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

                        • <tfoot id='Y7zKP'></tfoot><legend id='Y7zKP'><style id='Y7zKP'><dir id='Y7zKP'><q id='Y7zKP'></q></dir></style></legend>
                            主站蜘蛛池模板: 欧美理论在线观看 | 亚洲福利| 国产亚洲精品久久久久动 | 成人在线中文字幕 | h在线免费观看 | 国产精品视频一区二区三区不卡 | 成人精品一区亚洲午夜久久久 | 国产高清精品一区二区三区 | 国产精品一区二区在线 | 久久精品欧美电影 | 久久国产精品免费一区二区三区 | 在线一区视频 | 一区二区视频在线 | 亚洲国产精品一区二区久久 | 久久逼逼| 国产精品美女久久久久aⅴ国产馆 | 久久精品中文字幕 | 日韩在线高清 | 卡通动漫第一页 | 日韩在线视频网址 | 久久91 | 免费毛片网站 | 亚洲国产一区二区在线 | 久久久久久国产精品三区 | 日韩一二三区视频 | 成人在线中文字幕 | 男人的天堂视频网站 | 精品一区二区久久久久久久网站 | 国产精品免费在线 | 99精品久久久久久 | 国产精品毛片一区二区三区 | 欧美日韩精品影院 | 一区二区三区高清不卡 | 99久久精品免费看国产高清 | 欧美一区免费 | 久久精品视频免费观看 | 久久久久久av| 正在播放国产精品 | 伊人网国产 | 国产欧美精品在线观看 | 精品国产一区二区三区成人影院 |