2
votes

I'm getting the following error:

LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

I'm working on a 64 bit machine (VS2008) and I have the x64 compiler. I checked that the build is on x64.

Why isn't it compiling? Here's the build log:

echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.1\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --machine 32 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.1\include" -maxrregcount=0 --compile -o "x64\Debug/lowWrappers.cu.obj" lowWrappers.cu

3

3 Answers

2
votes

In the top of the properties dialogue, there's a Platform dropdown. That should say "Active(x64)". If it says "Active(Win32)", that's your problem. Click "Configuration Manager..." in the top right, select the platform for your project, select "" and find x64. You can then delete the Win32 platform if you like.

1
votes

(this might be a bit out of date...but I found a fix, since I just ran into this problem).

The short answer, in your Project Properties->Configuration Properties->CUDA RuntimeAPI->Host set the "Target Machine Platform" to x64. (mine was at x86 despite having the platform at x64).

0
votes

Make sure that any libraries you are using have also been compiled on 64 bit.