error LNK2019: 无法解析的外部符号,解决办法

摘要:
$ basic_string@DU ; 基本字符串&lt,字符特征&lt:分配器&lt:$basic_string@DU :$ char_traits@D@标准@@V;basic_string&lt:char_traits&lt:void(__cdecl*)(int;$basic_string@DU:矩形&lt:basic_string<

最近在看一个程序,每次编译时都会出现

chushihua.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@1@@Z),该符号在函数 "void __cdecl mouseEvent(int,int,int,int,void *)" (?mouseEvent@@YAXHHHHPAX@Z) 中被引用
1>chushihua.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::destroyWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?destroyWindow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z),该符号在函数 "void __cdecl InitialVideo(class cv::Mat &,class cv::Rect_<int> &)" (?InitialVideo@@YAXAAVMat@cv@@AAV?$Rect_@H@2@@Z) 中被引用
1>chushihua.obj : error LNK2019: 无法解析的外部符号 "int __cdecl cv::waitKey(int)" (?waitKey@cv@@YAHH@Z),该符号在函数 "void __cdecl InitialVideo(class cv::Mat &,class cv::Rect_<int> &)" (?InitialVideo@@YAXAAVMat@cv@@AAV?$Rect_@H@2@@Z) 中被引用
1>chushihua.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::setMouseCallback(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,void (__cdecl*)(int,int,int,int,void *),void *)" (?setMouseCallback@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@P6AXHHHHPAX@Z1@Z),该符号在函数 "void __cdecl InitialVideo(class cv::Mat &,class cv::Rect_<int> &)" (?InitialVideo@@YAXAAVMat@cv@@AAV?$Rect_@H@2@@Z) 中被引用
1>chushihua.obj : error LNK2019: 无法解析的外部符号 "public: virtual __thiscall cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UAE@XZ),该符号在函数 _main 中被引用
1>chushihua.obj : error LNK2019: 无法解析的外部符号 "public: virtual bool __thiscall cv::VideoCapture::isOpened(void)const " (?isOpened@VideoCapture@cv@@UBE_NXZ),该符号在函数 _main 中被引用
1>chushihua.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall cv::VideoCapture::VideoCapture(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0VideoCapture@cv@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z),该符号在函数 _main 中被引用
1>D:\code\chushihua\Debug\chushihua.exe : fatal error LNK1120: 7 个无法解析的外部命令

通过在网上查资料,是缺少库文件,我的编程环境是VS2008+OpenCV2.3,所以加上

#pragma comment( lib, "opencv_highgui231d.lib")
#pragma comment( lib, "opencv_core231d.lib")就可以了

一般遇到这种问题就是缺少库文件,在头文件后面加入#pragma comment( lib, "*****.lib")就OK

免责声明:文章转载自《error LNK2019: 无法解析的外部符号,解决办法》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇前端小白之每天学习记录----js简单的组件封装unittest自定义封装与应用下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

从核函数到SVM原理--sklearn-SVM实现

SVM核函数及sklearn实现SVM 在SVM中,其中最重要的也是最核心的就是核函数的选取和参数选择,当然这个需要大量的经验来支撑。今天我们就是抛砖引玉形象的讲解一下什么是核函数,及在SVM中在哪用到。 我们知道,SVM相对感知机而言,它可以解决线性不可分的问题,那么它是怎么解决的呢?它的解决思想很简单,就是对原始数据的维度变换,一般是扩维变换,使得原样...

c++ Beep(发声函数)

c++ Beep(发声函数) Windows API 提供了一个奇妙的发音函数-Beep函数。Beep可以通过控制主板扬声器的发声频率和节拍来演奏美妙的旋律 Beep函数原型 BOOL Beep( DWORD dwFreq; DWORD dwDuration; ); dwFreq 指定要发出的频率(HZ) dwDuration 指...

用句柄操作下拉框

你要获得组合框的句柄做什么呢?是要读取组合框条目的值还是进行什么操作呢?要读取值用selectedIndex读取索引值(从0开始),用selectedItem读取选项的内容(要进行类型转换),用selectedIndex.key可以获得按键值;要完成句柄的操作也有三种方式,用其一也可,但工程较大,用于Windows编程:1、用父窗口的函数: WM_DRAW...

动态链接库

  动态链接库(DLL),其是windows操作系统的基础,其通常不能直接运行,也不能接收消息。它们是一些独立的文件,其中包含能被可执行程序或其他DLL调用来完成某项工作的函数。只有在其他模块调用动态链接库中的函数时,它才发挥作用。   Windows API中所有的函数都包含在DLL中,其中有3个重要的DLL。 Kernel32.dll 它包含那些用...

suricata的模块和插槽

参考资料 suricata官方文档https://suricata.readthedocs.io/en/latest/performance/runmodes.html#different-runmodes suricata的源代码https://blog.csdn.net/shenwansangz/article/details/37900875?utm...

动态规划法-01背包问题

一 几个概念: 最优化问题:有n个输入,它的解由这n个输入的一个子集组成,这个子集必须满足某些事先给定的条件,这些条件称为约束条件,满足约束条件的解称为问题的可行解。满足约束条件的可行解可能不止一个,为了衡量这些可行解的优劣,事先给出一定的标准,这些标准通常以函数的形式给出,这些标准函数称为目标函数,使目标函数取得极值的可行解成为最优解,这类问题称为最优...