Home > Back-end >  Bosses, when I'm on VS2017 opencv problems, how to solve, thank you
Bosses, when I'm on VS2017 opencv problems, how to solve, thank you

Time:10-02

1> -- -- -- -- -- - has started to generate: project: App1, configuration: Debug x64 -- -- -- -- -- --
1> App. The xaml. CPP
1> E: \ visual \ app1 \ app1 \ app xaml. CPP (20) : warning C4447: find the "main" signature without thread model, consider the use of "int main (Platform: : Array"1> Is creating library E: \ visual \ App1 \ x64 \ Debug \ App1 \. Lib and object E: \ visual \ App1 \ x64 \ Debug \ App1 \. Exp
1> XamlTypeInfo. G.o bj: error LNK2019: cannot resolve the external symbol of "public: __cdecl App1: : App: : App (void)" (?????? 0 app @ App1 @ @ QE $AAA @ XZ), the symbol in the function ": public void __cdecl & lt; Lambda_e924f65bb23802341b0121dad21d52f6 & gt; : : operator () (class Windows: : UI: : Xaml: : ApplicationInitializationCallbackParams ^) const (??????" R1> E: \ visual \ App1 \ x64 \ Debug \ App1 \. Exe: fatal error LNK1120: one cannot resolve the external command
1> Generating project has been completed. "vcxproj" operations - failure,
==========: zero success, failure, latest 0, 0 skip==========
==========deployment: success is zero, zero failure, skip the 0==========

1 error LNK1120 cannot resolve the external command App1 E: \ visual \ App1 \ x64 \ Debug \ App1 \. Exe 1

I is the first line of the # include & lt; Iostream>
Code like this:
# include & lt; Iostream>
# include & lt; String>
# include & lt; Sstream>
using namespace std;


//opencv# include "D:/OpenCV/OpenCV/OpenCV/build/include/opencv2/core/core HPP"
# include "D:/OpenCV/OpenCV/OpenCV/build/include/opencv2 highgui/highgui HPP"
Using the namespace CV;

//OPENCV command line parser function
//command line parsing
Const char * keys=
{
"{help h the usage? | | print this message}
""{@ video | | video file, if not defined the try to ues webcamera}"
};

Int main (int arg c, const char * * argv)
{
CommandLineParser parser (arg c, argv, keys);
Parser. The about (" Chapter 2. V1.0.0 ");
//if needed, select help document
If (parser. From the (" help "))
{
Parser. PrintMessage ();
return 0;
}
String videoFile=parser. Get (0);

//analysis params, check whether the params right
if (! Parser. Check ())
{
Parser. PrintErrors ();
return 0;
}
VideoCapture cap;//open the default camera
If (videoFile!="")
Cap. Open (videoFile);
The else
Cap. Open (0);
if (! Cap. IsOpened ())//check whether success
return -1;

NamedWindow (" Video ", 1);
For (;; )
{
Mat frame;
Cap & gt;> Frame;//get the camera frame
Imshow (" Video, "frame);
If (waitKey (30) & gt;=0) break;
}
//release the camera or video cap
Cap. Release ();

return 0;
}
The ball ball bosses, thanks

CodePudding user response:

The project type you create is Xaml: : Application
Do not modify the system automatically give you the generated function
To bosses: everyone has a dream alone will not talk and then there are the paradise
Problem has been solve