1>------ 已啟動生成: 專案: App1, 配置: Debug x64 ------
1>App.xaml.cpp
1>e:\visual\app1\app1\app.xaml.cpp(20): warning C4447: 找到的“main”簽名不帶執行緒模型。請考慮使用“int main(Platform::Array<Platform::String^>^ args)”。
1> 正在創建庫 E:\visual\App1\x64\Debug\App1\App1.lib 和物件 E:\visual\App1\x64\Debug\App1\App1.exp
1>XamlTypeInfo.g.obj : error LNK2019: 無法決議的外部符號 "public: __cdecl App1::App::App(void)" (??0App@App1@@QE$AAA@XZ),該符號在函式 "public: void __cdecl <lambda_e924f65bb23802341b0121dad21d52f6>::operator()(class Windows::UI::Xaml::ApplicationInitializationCallbackParams ^)const " (??R<lambda_e924f65bb23802341b0121dad21d52f6>@@QEBAXPE$AAVApplicationInitializationCallbackParams@Xaml@UI@Windows@@@Z) 中被參考
1>E:\visual\App1\x64\Debug\App1\App1.exe : fatal error LNK1120: 1 個無法決議的外部命令
1>已完成生成專案“App1.vcxproj”的操作 - 失敗。
========== 生成: 成功 0 個,失敗 1 個,最新 0 個,跳過 0 個 ==========
========== 部署: 成功 0 個,失敗 0 個,跳過 0 個 ==========
錯誤 LNK1120 1 個無法決議的外部命令 App1 E:\visual\App1\x64\Debug\App1\App1.exe 1
我的第一行是#include <iostream>
代碼是這樣的:
#include <iostream>
#include <string>
#include <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 namespace cv;
//OPENCV命令列決議器函式
//命令列決議
const char*keys =
{
"{help h usage ? || print this message}"
"{@video|| Video file,if not defined try to ues webcamera}"
};
int main(int argc,const char**argv)
{
CommandLineParser parser(argc, argv, keys);
parser.about("Chapter 2.v1.0.0");
//如果需要,選擇幫助檔案
if (parser.has("help"))
{
parser.printMessage();
return 0;
}
string videoFile = parser.get<string>(0);
//分析params的,檢查params是否正確
if (!parser.check())
{
parser.printErrors();
return 0;
}
VideoCapture cap;//打開默認相機
if (videoFile != "")
cap.open(videoFile);
else
cap.open(0);
if (!cap.isOpened())//檢查是否成功了
return -1;
namedWindow("Video", 1);
for (;;)
{
Mat frame;
cap >> frame;//獲取攝像機的幀
imshow("Video", frame);
if (waitKey(30) >= 0) break;
}
//釋放的攝像機或視頻cap
cap.release();
return 0;
}
球球大佬了,謝謝
uj5u.com熱心網友回復:
你創建的專案型別是Xaml::Application不要修改系統自動給你生成的函式
引至大佬:每個人都有一個夢才不會孤單的說話就有天堂
問題已解決
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/104404.html
標籤:C語言
