LNK2019 函数 main 中引用的未解析的外部符号 cvCreateImage

问题描述 投票:0回答:1

我尝试在我的 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
c++ visual-studio opencv lnk2019 unresolved-external
1个回答
0
投票

这里应该是opencvXXXd.lib的目录。 从截图来看是

<your path>\opencv\build\x64\vc14\lib

确保opencv3415d.lib的版本是你安装的版本。

您可能需要将opencvXXXd.dll的路径添加到系统环境路径中。 DLL 位于文件夹

opencv\build\x64\vc14\bin

© www.soinside.com 2019 - 2024. All rights reserved.