command Line for x64 Bit compilation RRS feed

  • Question

  • Hi,
    I m trying to compile my application for 64 bit targets. I am using visual studio standard edition -2005 SP1.(windows Xp-32 Bit )
    i used the following command line:

    cl.exe /nologo /W3 /O2 /Op /c  /Fo./x.obj x.c

    it doesn't generate 64 bit obj file.

    my query is how to make visual studio emit a 64 bit object file through command line?



    Wednesday, April 29, 2009 8:52 PM


  • You have to use the right compiler.  There are three of them, vc\bin\cl.exe is the 32-bit compiler, vc\bin\x86_amd64\cl.exe is a 32-bit compiler that generates 64-bit code, vc\bin\amd64\cl.exe is a 64-bit compiler that generates 64-bit code.  Setup your environment properly with vsvarsall.bat x64.  Or use the IDE to avoid having to deal with boring details like this.

    Note that the 64-bit compilers are not installed by default, you have to do a custom install.
    Hans Passant.
    • Proposed as answer by Albin Baby Thursday, April 30, 2009 7:04 AM
    • Marked as answer by Wesley Yao Wednesday, May 6, 2009 3:44 AM
    Wednesday, April 29, 2009 9:08 PM