gpt4 book ai didi

c++ - OpenCV 错误 : "LINK : fatal error LNK1104: cannot open file ' opencv_core231d. 库'”

转载 作者:太空狗 更新时间:2023-10-29 19:58:24 27 4
gpt4 key购买 nike

我试图在 visual studio + opencv 中编译一个简单的代码,但出现了这个错误。

代码:

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace cv;

int main ( int argc, char **argv )

{
Mat im_gray;
Mat img_bw;
Mat img_final;

Mat im_rgb = imread("001.jpg");
cvtColor(im_rgb,im_gray,CV_RGB2GRAY);

adaptiveThreshold(im_gray, img_bw, 255, ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY_INV, 105, 1);

imwrite("001-bw2.jpg", img_final);
return 0;
}

输出:

1>------ Build started: Project: pibiti, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'opencv_core231d.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

链接器 >> 输入:

opencv_core231d.lib
opencv_highgui231d.lib
opencv_video231d.lib
opencv_ml231d.lib
opencv_legacy231d.lib
opencv_imgproc231d.lib
tbb_debug.lib
tbb_preview_debug.lib
tbbmalloc_debug.lib
tbbmalloc_proxy_debug.lib
tbbproxy_debug.lib

我该如何解决这个问题?文件 'opencv_core231d.lib' 已经存在,为什么会出现这个错误?

最佳答案

将库文件的路径添加到库路径中。

右键单击该项目并转到“属性”->“链接器”->“附加库目录”。将路径添加到此列表。

关于c++ - OpenCV 错误 : "LINK : fatal error LNK1104: cannot open file ' opencv_core231d. 库'”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21744464/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com