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]
- Visual Studio 2013 configuration OpenCV graphic tutorial Opencv249 installation configuration tutorial
- Visual Studio 2017 + OpenCV environment building tutorial
- How to configure OpenCV in Visual Studio 2010
- python 3x - i want to run anaconda3 python from visual studio code it may or may not move
- visual studio 2015 + opencv2413 configuration tutorial
- Visual Studio 2017 155 officially released! Performance improved
- Visual Studio 2013 + OpenCV2410 environment building tutorial
- Analysis of Visual Studio Code breakpoint debugging Vue
- Workaround for incomplete uninstallation of Visual Studio
- How to use Taobao image in Visual Studio 2017
- How to modify some contents in Visual Studio 2017 with regular
- Visual Studio 2015 configuration of Opencv32
- visual studio build dll type project, console program
- Visual Studio Code method for configuring C and C ++ environment and writing and running
- Getting Started with Visual Studio Debug Practical Tutorials
- Visual Studio 2017 community installation and configuration method graphic tutorial
- Visual Studio 2017 installation and use tutorial
- Visual Studio IDE does not display the window or flashes when writing a program
- Breakpoint operation of Visual Studio Debug combat tutorial
- c ++ - e1696 cannot open source file "opencv2/opencvhpp" error occurs and cpp file cannot be built
- [visual c ++] sample code cannot be executed due to "e1696 source file cannot be opened" error
- pc specs for developing c ++ in visual studio 2019
- i want to write to the specified address with the mov instruction in visual c/c ++ inline assembler, but it becomes an invalid o
- c # - i want to change bitmap-24bit to 254 (reduced color) of bitmap-8bit in c♯
- when debugging a c language program with visual studio 2019, an error occurred please help me because i am not sure
- cmake - when cv :: text :: ocrtesseract :: create is built with visual studio, an unresolved external reference lnk1120 or lnk20
- c ++ - how to use the class set in the main game loop in another class
- why the type of i becomes size_t when completing for loop in c ++ vs
- c ++ - i don't understand the reason why it becomes re on dsl_1_a of aizu online judge