I am running Visual Studio 2019 on Windows10. As a project, I have selected "Windows Desktop Application" that can create an application with a graphical user interface that runs on Windows, but I cannot use OpenCV well.About OpenCV settings
Download the Windows file from here and unzip it
C: \ hoge \ opencv \
It is put in. For example, opencv.hpp is
C: \ hoge \ opencv \ build \ include \ opencv2 \ opencv.hpp
It is in. Also, in the Windows10 path
C: \ hoge \ opencv \ build \ x64 \ vc15 \ bin
Has been added.
Visual Studio 2019 is installed as standard.
A project called WinPro is created in C: \ hoge \.
When you build, a file called C: \ hoge \ WinPro \ Debug \ WinPro.exe is created.
To use OpenCV, include it in the include path of Visual Studio
C: \ hoge \ opencv \ build \ include \
Has been added.
Also, the Visual Studio library path includes
C: \ hoge \ opencv \ build \ x64 \ vc15 \ lib
Has been added.
From line 4 to line 6 of WinPro.cpp
#include "framework.h" #include "WinPro.h" #include "opencv2/opencv.hpp" // add this line
I was able to build successfully.
I want to display an image file called C: \ hoge \ WinPro \ picture.png in the main window. So, in lines 29-30 of WinPro.cpp,
// TODO: Insert the code here. cv :: Mat img;// add this line
1>------ Start build: Project: WinPro, Configuration: Debug x64 ------ 1>WinPro.cpp 1>WinPro.obj: error LNK2019: Unresolved external symbol "void __cdecl cv :: fastFree (void *)" (? FastFree @ cv @@ YAXPEAX @ Z) is function "public: __cdecl cv :: Mat :: ~ Mat (void) "(?? 1Mat @ cv @@ QEAA @ XZ) 1>WinPro.obj: error LNK2019: Unresolved external symbol "public: void __cdecl cv :: Mat :: deallocate (void)" (? Deallocate @ Mat @ cv @@ QEAAXXZ) is a function "public: void __cdecl cv: : Mat :: release (void) "(? Release @ Mat @ cv @@ QEAAXXZ) 1>C: \ hoge \ WinPro \ x64 \ Debug \ WinPro.exe: fatal error LNK1120: 2 unresolved external references 1>Build of project "WinPro.vcxproj" finished-failed. ========== Build: 0 successful, 1 failed, 0 no update required, 0 skipped ==========
is displayed and building is not possible.
Answer # 1
1>C: \ hoge \ WinPro \ x64 \ Debug \ WinPro.exe: fatal error LNK1120: 2 unresolved external references
It's a link error when building Visual Studio 2019. If you continue to use OpenCV, it is better to review and set up the environment settings for the build once. In this StackOverflow, similar questions have been posted several times in the past. If you search for "Windows OpenCV" in "Search by keyword", you may get something useful.
Linker settings when using opencv in VS2019-StackOverflow # 215829
A little older than 2015
OpenCV] I want to use OpenCV in C language on Windows-StackOverflow # 14459
There are articles compiled by @IT outside StackOverflow.
3rd OpenCV environment construction (OpenCV 3.0/3.1) (1/3)[email protected] OpenCV introduction [3.0 support]
- How to configure OpenCV in Visual Studio 2010
- Visual Studio 2013 configuration OpenCV graphic tutorial Opencv249 installation configuration tutorial
- visual studio - introduction of opencv using mfc application
- Visual Studio 2017 + OpenCV environment building tutorial
- C # programming and Visual Studio skills (below)
- Visual Studio 2017 new release is more powerful!
- How Visual Studio 2013 makes XML files into classes
- Share 10 debugging skills of Visual Studio native development (2)
- Visual Studio 2012 installation and configuration method graphic tutorial with opencv configuration tutorial
- Visual Studio 2015 Boost library configuration tutorial
- Visual Studio for Mac first experience
- Visual Studio Debugger seven little-known features
- Visual Studio debugging tips summary
- Visual Studio (VS2017) configure C/C ++ PostgreSQL 963 development environment
- Breakpoint debugging Nodejs with Visual Studio Code
- visual studio code debug php method (detailed graphic)
- Visual Studio Code uses Git for version control (graphic tutorial)
- C language to create dynamic dll and call dll (visual studio 2013 environment)
- Visual Studio Code (vscode) git tutorial
- [visual c ++] sample code cannot be executed due to "e1696 source file cannot be opened" error
- opencv2/opencvhpp cannot be included
- c ++ - e1696 cannot open source file "opencv2/opencvhpp" error occurs and cpp file cannot be built
- greatest common divisor has strange value
- visual c ++ - how to use openmp in visual studio 2019 (c ++)
- visual c ++ - exception is occurring from kernelbasedll
- where is the file created by the fopen function of visual studio 2019 located?
- visual c ++ - i tried installing the developer command prompt for visual studio, but i got an error
- c ++ - how to use the class set in the main game loop in another class
- [visual studio 2010] debug output [visual c ++]