How to Solve OpenCV CVUI Error: LINK2019

OpenCV CVUI Error: LINK2019

1、Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol “void __cdecl cvui::init(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int,bool)” ([email protected]@@YAXAEBV?b a s i c s t r i n g @ D U ? [email protected]?basic 
s
​
 [email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) referenced in function main

2、Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol “bool __cdecl cvui::button(class cv::Mat &,int,int,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” ([email protected]@@[email protected]@@HHAEBV?b a s i c s t r i n g @ D U ? [email protected]?basic 
s
​
 [email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) referenced in function main DotMatrix

3、Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol “void __cdecl cvui::printf(class cv::Mat &,int,int,double,unsigned int,char const *,…)” ([email protected]@@[email protected]@@HHNIPEBDZZ) referenced in function main

4、Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol “void __cdecl cvui::update(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” ([email protected]@@YAXAEBV?b a s i c s t r i n g @ D U ? [email protected]?basic 
s
​
 [email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) referenced in function main DotMatrix

 

Solution:

Add the codes below before the .cpp

#define CVUI_IMPLEMENTATION
#include "cvui.h"

Read More: