x64 build error module machine type 'X86' conflicts with target machine type 'x64'

Hello,

im geeting the next error:
LNK1112: module machine type ‘X86’ conflicts with target machine type ‘x64’

Im working on 64bit machine (VS2008) and i have the x64 compiler.
I checked that the build is on x64.

Can anyone please advise?

Thanks!!!

One of the libraries (or object files) you are linking in are compiled as 32 bit, but your image is 64 bit.
You need to find out which library (or object file) is that, and make sure you link with 64 bit version.

Sergey.

you mean the dll file?

the only dlls are:

cudart.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

You could be linking to 32bit cudart.lib. I’d start removing libraries one by one until this particular error message goes away, then you have found the problematic library.

also check your solution configuration. I remember vs2008 was messing up if you had multiple project in the solution, then sometime it would randomly change individual project to be 32 bit.

Thanks,

I tried to remove the cudart but it didnt help.
the rest of the dlls are inherited and unremovable.

what do i have to check in the solution configuration?

In the platform selection drop down box at the end there is “Configuration Manager” line. Use that. Alternatively you can copy the link command line from visual studio log files and reproduce it yourself using console, then remove all object files and libraries one by one until the x86-x64 incompatibility goes away, then you have found the incompatible lib/obj file.