views:

177

answers:

3

Hi. 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 ?

+1  A: 

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

karlphillip
A: 

Ok, I did this. I think that everything is going well, expect facing a linking error. Please see here: http://forums.nvidia.com/index.php?showtopic=181766

Gaurav Kalra
@Gaurav - I've responded to your post, please don't add your questions as an "answer" to someone else's question. http://stackoverflow.com/questions/3824886/cuda-linking-error-visual-studio-2008/3827896#3827896
M. Tibbits
@Gaurav I updated my answer a few days ago, don't forget to check it.
karlphillip
A: 

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.

M. Tibbits