在 64 位机器上使用 Visual Studio 配置 CUDA 和 OpenCV

发布于 2024-09-24 23:54:42 字数 424 浏览 0 评论 0原文

自过去 1 周以来,我一直在尝试在 64 位 Windows XP 计算机上的 Visual Studio 2008 上配置 OpenCV2.1 和 CUDA3.1。但一切都是徒劳。

仅 OpenCV 就可以正常工作。单独使用 CUDA3.1 也可以正常工作。 我正在使用 64 位的 CUDA3.1 ...但是对于 OpenCV,我正在使用 32 位安装(如 Source Forge 上提供的)- 可能的错误?

在 CUDA 项目中,当我配置 OpenCV 设置并编译示例项目时,我在以下文件中收到错误:

cxcore.hpp cx操作.hpp CXCore.hpp cxmat.hpp 以及 CUDA 构建规则。

以上所有文件都不是我写的;但都是图书馆(我猜)。

有没有在 64 位 XP 机器上通过 VS 安装 CUDA、OpenCV 的说明?

I have been trying to configure OpenCV2.1 and CUDA3.1 on Visual Studio 2008 on a 64bit Windows XP machine, since past 1 week. But all in vain.

OpenCV alone is working fine. CUDA3.1 alone is working fine as well.
I am using CUDA3.1 for 64 bit ... But for OpenCV, I am using 32 bit installation (as provided on Source Forge) - Possible Error ??

In a CUDA project when I configure OpenCV settings, and compile a sample project, I get error on following files:

cxcore.hpp
cxoperations.hpp
cxcore.hpp
cxmat.hpp
and also on CUDA build rules.

All the above files are not written by me; but are libraries (I guess).

Any directions to install CUDA, OpenCV over VS on a 64bit XP machine ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独自←快乐 2024-10-01 23:54:42

链接到您的应用程序的库应该已编译到相同的架构。你不能混合架构。

换句话说,您必须将所有内容编译(您的应用程序、OpenCV 和 CUDA)编译为 32 位(如果需要,也可以编译为 64 位)。

我给您的建议是编译 32 位的 CUDA,然后更改项目的属性以将应用程序构建为 32 位(因为您已经拥有 32 位版本的 OpenCV )。

编辑:

对于链接问题:

unresolved external symbol _cufftExecR2C@12
unresolved external symbol _cufftExecC2R@12
unresolved external symbol _cufftPlan2d@16
unresolved external symbol _cufftDestroy@4

根据这篇文章,将此库添加到您的项目设置中:cufft.lib

Libraries linked to your application should have been compiled to the same arch. You cannot mix architectures.

In other words, you must compile everything -- your app, OpenCV and CUDA -- to be 32bit (or 64 bits if you need).

My advice to you is compile CUDA for 32bits and then change the properties of your project to build your application to 32bits too (since you already have the 32bits version of OpenCV ).

EDIT:

For the linking problems:

unresolved external symbol _cufftExecR2C@12
unresolved external symbol _cufftExecC2R@12
unresolved external symbol _cufftPlan2d@16
unresolved external symbol _cufftDestroy@4

according to this post, add this library to your project settings: cufft.lib

层林尽染 2024-10-01 23:54:42

我相信您需要构建 Cmake 的 64 位库——但我不确定。您肯定需要在 x64 中构建 OpenCV,才能在 Win XP x64 安装上构建本机应用程序。如果 OpenCV 的构建显示错误,那么您需要先解决这些错误,然后再尝试编译链接到尚未正确编译的 OpenCV 库的应用程序。

I believe that you need to build Cmake's 64 bit libraries -- but I'm not certain. You definitely need to build OpenCV in x64 to build native apps on a Win XP x64 install. If the build of OpenCV is showing errors, then you'll need to solve those first before attempting to compile your app which links against the as of yet incorrectly compiled OpenCV libs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文