在编译此非常简单的代码时,即使包含所有库,以及这些库的路径,我也收到LNK2019错误:
#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/core/ocl.hpp>
using namespace cv;
int main(int argc, char** argv) {
VideoCapture cap(0); // Open the default camera.
if (!cap.isOpened()) {
std::cout << "No camera connected!" << std::endl;
return -1;
}
Mat edges;
namedWindow("View", WINDOW_AUTOSIZE);
while (waitKey(1) == -1) {
Mat frame;
cap >> frame; // Get a new frame from the camera.
imshow("View", frame);
}
}
我已经包括了名为bellow的Additional Dependencies文件,这是编译该程序所需的全部文件。
opencv_core410.lib
opencv_videoio410.lib
opencv_imgproc410.lib
opencv_highgui410.lib
opencv_tracking410.lib
奇怪的是,它只给我一个imshow
尚未解决的外部问题。
这是错误消息:
1>Application.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::debug_build_guard::_InputArray const &)" (?imshow@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@debug_build_guard@1@@Z) referenced in function main