在 64 位机器上使用 Visual Studio 配置 CUDA 和 OpenCV
自过去 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
链接到您的应用程序的库应该已编译到相同的架构。你不能混合架构。
换句话说,您必须将所有内容编译(您的应用程序、OpenCV 和 CUDA)编译为 32 位(如果需要,也可以编译为 64 位)。
我给您的建议是编译 32 位的 CUDA,然后更改项目的属性以将应用程序构建为 32 位(因为您已经拥有 32 位版本的 OpenCV )。
编辑:
对于链接问题:
根据这篇文章,将此库添加到您的项目设置中: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:
according to this post, add this library to your project settings: cufft.lib
我相信您需要构建 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.