Visual-studio – ‘X86’ conflicts with target machine type ‘x64’

visual studio

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

Best Answer

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.

Related Topic