none
module machine type 'x64' conflicts with target machine type 'X86'

    Question

  • I have converted my project to x64 using Visual Studio Configuration Manager. This is the 2005 Visual Studio Pro final edition, downloaded from MSDN. It all build fine but will not link. I get the following message:

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

    The compiler command lines look like this:

    /Od /I "..\..\..\..\..\src" /D "_CRTDBG_MAP_ALLOC" /D "PROJ_SAX2" /D "_DEBUG" /D "PROJ_XMLPARSER" /D "PROJ_XMLUTIL" /D "PROJ_PARSERS" /D "PROJ_SAX4C" /D "PROJ_DOM" /D "PROJ_VALIDATORS" /D "XML_SINGLEDLL" /D "WIN32" /D "_WINDOWS" /D "XML_USE_WIN32_TRANSCODER" /D "XML_USE_WIN32_MSGLOADER" /D "XML_USE_NETACCESSOR_WINSOCK" /D "XERCES_NO_ASM" /D "_VC80_UPGRADE=0x0710" /D "_WINDLL" /FD /EHsc /MDd /Fp".\..\..\..\..\..\Build\Win32\VC8\Debug\obj/XercesLib.pch" /Fo".\..\..\..\..\..\Build\Win32\VC8\Debug\obj/" /Fd".\..\..\..\..\..\Build\Win32\VC8\Debug\obj/" /W3 /nologo /c /Zi /errorReport:prompt

    and the linker command lines like this:

    /OUT:"..\..\..\..\..\Build\Win32\VC8\Debug/xerces-c_2_7D.dll" /INCREMENTAL /NOLOGO /LIBPATH:"..\..\..\..\..\Build\Win32\VC8\Debug" /DLL /MANIFEST /MANIFESTFILE:"x64\Debug\xerces-c_2_7D.dll.intermediate.manifest" /DEBUG /PDB:".\..\..\..\..\..\Build\Win32\VC8\Debug/xerces-c_2_7D.pdb" /SUBSYSTEM:WINDOWS /RELEASE /BASE:"0x12000000" /IMPLIB:"..\..\..\..\..\Build\Win32\VC8\Debug/xerces-c_2D.lib" /MACHINE:X64 /ERRORREPORT:PROMPT ws2_32.lib advapi32.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

    Any suggestions?

    thanks,
    David

    Wednesday, November 23, 2005 12:39 AM

Answers

  • The MachineX64 is set properly for the linker.

    I believe that I found the problem. In the command line for the linker, under additional options, there was something like this:

    /MACHINE:I386

    When I change that to:

    /MACHINE:AMD64

    it links.

    Thanks for your help.

    Wednesday, November 23, 2005 1:37 AM

All replies

  • /LIBPATH:"..\..\..\..\..\Build\Win32\VC8\Debug"

    Couldn't that be a problem? From what I can tell you have one or more of the libraries or object files that are being including targeted to x86. Does this project depend on another project and is that being built for x64?
    Wednesday, November 23, 2005 1:04 AM
  • Also, make sure that the target machine field of the solution properties under configuration properties --> linker --> advanced is set to MachineX64.

    Thanks,
      Ayman Shoukry
      VC++ Team
    Wednesday, November 23, 2005 1:12 AM
    Moderator
  • I see where that is confusing, but its actually really is building for x64, and I believe that it is self contained. Those are just directory names left over from the original project. I will change them.
    Wednesday, November 23, 2005 1:31 AM
  • The MachineX64 is set properly for the linker.

    I believe that I found the problem. In the command line for the linker, under additional options, there was something like this:

    /MACHINE:I386

    When I change that to:

    /MACHINE:AMD64

    it links.

    Thanks for your help.

    Wednesday, November 23, 2005 1:37 AM
  • Hi, I almost have the same problem but the solution here didn't worked.

    I have Visual Studio 2005 professionnal edition.

    /Od /I "utilite\include" /I "noyau\include" /I "C:\Program Files\Common Files\System\ado" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "HYDROTEL_CONSOLE" /D "LECTURE_BINAIRE" /D "_VC80_UPGRADE=0x0600" /D "_AFXDLL" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Fp".\Debug/HydrotelKernel.pch" /Fo".\Debug/" /Fd".\Debug/" /W3 /nologo /c /Zi /TP /showIncludes /errorReport:prompt

    /OUT:".\Debug/HydrotelKernel.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"x64\Debug\HydrotelKernel.exe.intermediate.manifest" /DEBUG /PDB:".\Debug/HydrotelKernel.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X64 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

    I don't know why I don't have the /LIBPATH...

    thanks for the help,

     

    Friday, August 11, 2006 6:33 PM
  • Thanks you SO much ddunkle !
    Friday, March 05, 2010 5:27 AM