fatal error LNK1112 fatal error LNK1112: module machine type 'x64' conflicts with

OS Vista 64 Bits
CPU AMD 955 foure core
Graphic card FX-1800

Went I try to compile it I get the following error

I very new at this how do I correct this error "\Debug\cudaOpenMP.cu.obj : fatal error LNK1112: module machine type ‘x64’ conflicts with target machine type ‘X86’

Build started: Project: cudaOpenMP, Configuration: Debug|Win32
Command Lines Creating temporary file “e:\cuda\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\Debug\BAT0000041000576.bat” with contents
[
@echo off

echo “d:\CUDA\bin64\nvcc.exe” -arch sm_10 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin” -Xcompiler “/EHsc /W3 /nologo /Od /Zi /MTd " -I"d:\CUDA\include” -I"…/…/common/inc" -maxrregcount=32 --compile -o “Debug\cudaOpenMP.cu.obj” “e:\cuda\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\cudaOpenMP.cu”

“d:\CUDA\bin64\nvcc.exe” -arch sm_10 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin” -Xcompiler “/EHsc /W3 /nologo /Od /Zi /MTd " -I"d:\CUDA\include” -I"…/…/common/inc" -maxrregcount=32 --compile -o “Debug\cudaOpenMP.cu.obj” “e:\cuda\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\cudaOpenMP.cu”

if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

echo Project : error PRJ0019: A tool returned an error code from “Compiling with CUDA Build Rule…”

exit 1

:VCEnd
]
Creating command line “”“e:\cuda\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\Debug\BAT0000041000576.bat”“”
Creating temporary file “e:\cuda\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\Debug\RSP0000051000576.rsp” with contents
[
/OUT:“…/…/bin/win32/Debug/cudaOpenMP.exe” /INCREMENTAL:NO /LIBPATH:“d:\CUDA\lib64” /LIBPATH:“…/…/common/lib” /MANIFEST /MANIFESTFILE:“Debug\cudaOpenMP.exe.intermediate.manifest” /MANIFESTUAC:“level=‘asInvoker’ uiAccess=‘false’” /DEBUG /PDB:“Debug/cudaOpenMP.pdb” /SUBSYSTEM:CONSOLE /OPT:NOICF /DYNAMICBASE:NO /MACHINE:X86 cudart.lib cutil32D.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

“.\Debug\cudaOpenMP.cu.obj”
]
Creating command line “link.exe @“e:\cuda\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\Debug\RSP0000051000576.rsp” /NOLOGO /ERRORREPORT:PROMPT”
Output Window Compiling with CUDA Build Rule…
“d:\CUDA\bin64\nvcc.exe” -arch sm_10 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin” -Xcompiler “/EHsc /W3 /nologo /Od /Zi /MTd " -I"d:\CUDA\include” -I"…/…/common/inc" -maxrregcount=32 --compile -o “Debug\cudaOpenMP.cu.obj” “e:\cuda\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\cudaOpenMP.cu”
cudaOpenMP.cu
tmpxft_000012f0_00000000-3_cudaOpenMP.cudafe1.gpu
tmpxft_000012f0_00000000-8_cudaOpenMP.cudafe2.gpu
tmpxft_000012f0_00000000-3_cudaOpenMP.cudafe1.cpp
tmpxft_000012f0_00000000-12_cudaOpenMP.ii
Linking…
.\Debug\cudaOpenMP.cu.obj : fatal error LNK1112: module machine type ‘x64’ conflicts with target machine type ‘X86’[b][/b][b][/b] Results Build log was saved at “file://e:\cuda\Exercises\test_mp\NVIDIA CUDA SDK\projects\cudaOpenMP\Debug\BuildLog.htm”
cudaOpenMP - 1 error(s), 0 warning(s)

You have installed the x64 toolkit, and is trying to compile a SDK sample on x86. Change the configuration to Release x64, or install the 32 bit(x86) toolkit.

Thank you I now able to get it to complile in 64Bit

now I get this error message

"LINK : fatal error LNK1181: cannot open input file ‘cutil64D.lib’ "

I did a search could not find this lib any ideas

Thank you very much for your help

If I understand this correctly, there is no way to switch between targeting x86 and x64 without reinstalling the toolkit? Or installing both to seperate directories and hacking some sort of CUDA_BIN_PATH environment variable switching mechanism?

Implementing that hack of course is made more difficult by the fact that changes to global environment variables require a restart of explorer since explorer starts all child processes and they will inherit what explorer sees when it starts (ie change CUDA_BIN_PATH, restart explorer, restart msvs, or rig a batch file to set the variable and then start msvs from it’s context).

Seems like this would be a great opportunity for NVidia to improve their toolset, we should be able to have a compiler run natively on either platform while targeting either platform. In fact if the compilers and tools were only native x86 but could target either x86 or x64 i’d be happy with that by itself.

I faced the problem too. My os is vista 64bit. And I have set the target machine as x64. But it shows module machine type x86 conflicts with target machine type x64. If I set the target machine as x86, there is no problem. The strangest thing is that two weeks ago the same program can work. I think maybe I have changed some windows configs. Dose anybody know how to fix it??
Thank you!!!

Well, that can happen when libraries don’t match target machine (i.e 32 bit libraries with 64 bit target machine or the other way around). Make sure your library path (Project Properties → Linker → General → Additional Library Directories) actually points to 32 or 64 bit depending on what you are compiling for. This is important in case you installed both 32 and 64 bit SDKs.

Hi

as far as I understand the problem…

I have similar problem with “cant open cutil64D.lib”, so I found the directory with this file and add the path to project, but after that, there appeared an other problem “cannot open file ‘C:\ProgramData\NVIDIA.obj’”. I’ve just removed the cutil64d.lib form whole project (so my program doesn’t use anything from cutil64d.lib).

now, my program just runs perfectly:)