Visual Studio LNK2019未解析的外部符号cvcid函数main中引用的图像

cgvd09ve  于 2023-10-23  发布在  其他
关注(0)|答案(1)|浏览(104)

我尝试在我的MS VS Codes 2022社区版本中构建一个代码片段。我配置了使用OpenCV中的功能所需的所有东西。但是,我得到了一组错误。我所做的配置如下所述。


错误:

Error   LNK1120 7 unresolved externals  Project1    D:\L4S1\DIP\Labs\Lab2\Project1\x64\Debug\Project1.exe   1   
Error   LNK2019 unresolved external symbol cvWaitKey referenced in function main    Project1    D:\L4S1\DIP\Labs\Lab2\Project1\Project1\Lab1.obj    1   
Error   LNK2019 unresolved external symbol cvDestroyWindow referenced in function main  Project1    D:\L4S1\DIP\Labs\Lab2\Project1\Project1\Lab1.obj    1   
Error   LNK2019 unresolved external symbol cvShowImage referenced in function main  Project1    D:\L4S1\DIP\Labs\Lab2\Project1\Project1\Lab1.obj    1   
Error   LNK2019 unresolved external symbol cvNamedWindow referenced in function main    Project1    D:\L4S1\DIP\Labs\Lab2\Project1\Project1\Lab1.obj    1   
Error   LNK2019 unresolved external symbol cvLoadImage referenced in function main  Project1    D:\L4S1\DIP\Labs\Lab2\Project1\Project1\Lab1.obj    1   
Error   LNK2019 unresolved external symbol cvReleaseImage referenced in function main   Project1    D:\L4S1\DIP\Labs\Lab2\Project1\Project1\Lab1.obj    1   
Error   LNK2019 unresolved external symbol cvCreateImage referenced in function main    Project1    D:\L4S1\DIP\Labs\Lab2\Project1\Project1\Lab1.obj    1
w3nuxt5m

w3nuxt5m1#

当在Linker下进行配置时,我犯了一个错误。当配置处于禁用状态时,需要在输入字段下添加opencv_world3413d.lib。在我上面发布的问题中,我把它放在了链接器部分的General下。正确的配置应如下所示,

相关问题