【问题标题】:Added opencv_world400.lib and opencv_world400d.lib to dependencies, still getting LNK2001 errors将 opencv_world400.lib 和 opencv_world400d.lib 添加到依赖项中,仍然出现 LNK2001 错误
【发布时间】:2018-11-27 03:31:06
【问题描述】:

我已将 opencv_world400.lib 和 opencv_world400d.lib 添加到依赖项中,但在 MSVS2017 中仍然出现此错误:

1>------ Build started: Project: OpenCLTest, Configuration: Release x64 ------
1>OpenCLTest.obj : error LNK2001: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd@cv@@YAHPEAHH@Z)
1>c:\users\chubak\documents\visual studio 2017\Projects\OpenCLTest\x64\Release\OpenCLTest.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "OpenCLTest.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

文件夹中没有其他 lib 文件,只有这两个。是什么导致这个问题我不知道。

代码如下:

#include "stdafx.h"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>

using namespace std;
using namespace cv;

int main()
{
    Mat image = imread("C:\\Users\\Chubak\\Pictures\\index.jpg");
    if (image.empty())
        return -1;
    imshow("TEST", image);
    waitKey();

    return 0;
}

【问题讨论】:

    标签: c++ visual-studio opencv


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2016-11-27
    • 2020-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-28
    • 1970-01-01
    相关资源
    最近更新 更多