c++ - CUDA - OpenCV - Visual Studio 2010 中的 C++ 链接错误

标签 c++ visual-studio-2010 opencv cuda

我正在使用 Visual Studio 2010 环境,并试图在 CUDA 的帮助下加速我以前编写的一些 OpenCV 算法。我有一个单独的 .cu 文件,可以在 Visual Studio 中单独编译,我的 .cpp 文件也可以单独编译。

但是当我尝试构建包含这两个文件的解决方案时,出现如下错误:

error LNK2019: unresolved external symbol "void __cdecl ComputeBasisKernelWrapper(float *,float *,float *,float *,float *,float *,float *,float *,float *,int,int)"

ComputeBasisKernelWrapper 是在 .cu 文件中使用 extern "C"定义的函数,负责进行必要的 CUDA 分配并执行并行计算。

我有一个类似的框架,它在我使用非面向对象的 .c 文件调用 .cu 文件中的函数时运行良好。

因此,我不确定是否需要对编译设置进行一些更改,或者是否存在其他问题。

感谢任何帮助。

最佳答案

通过删除“extern”解决了这个问题。

关于c++ - CUDA - OpenCV - Visual Studio 2010 中的 C++ 链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16785970/

相关文章:

c++ - Visual Studio 2010 和 boost::bind

opencv - "detecting object"opencv 的 HOG

opencv - 如何设置包含路径#include “opencv2/opencv.hpp”

c++ - 人体部位 HAAR 级联分类器

c++ - Boost 数值常量优点

c++ - 关于auto_ptr的一个问题

c++ - 将外部 dll 项目用于 Excel 的 c++/xll 插件

visual-studio-2010 - 在Visual Studio 2010中的cvQueryFrame执行

image-processing - 使用 openCV 检测图案区域

c++ - 如何将 C++ COM 组件升级到云部署