CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003

    Where is _M_X64 in the 64-bit project?

    The code snippet shows different compilations on 3 platforms with different preprocessors/macros.

    #if defined _M_IX86
    cout << _T(" (x86)");
    #elif defined _M_X64
    cout << _T(" (x64)");
    #elif defined _M_IA64
    cout << _T(" (Itanium)");

    Now I am porting a Win32 project to 64-bit Windows. In the 64-bit project, I don't find where is _M_X64, i.e. no such statement as "#define _M_X64" in the header or source files, I open the project property, and don't find _M_X64 preprocessor/macro defined in the the linker or c++ tabs. by the way I run visual studio 2008 on 32-bit windows XP.

    Should I manually add the statement "#define _M_X64" into the project? (However, according to MSDN, this macro cannot be redefined. ).

    Or is there any other ways I don't know and should follow? Thanks for help!

  2. #2
    Join Date
    Oct 2002
    Timisoara, Romania

    Re: Where is _M_X64 in the 64-bit project?

    No, it's defined by the compiler when you select x64 as your target platform (from the project property).
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Jan 2003

    Re: Where is _M_X64 in the 64-bit project?

    Thank you cilu!

    I select x64 as the target platform, and open the project property, but there is no _M_X64 defined in both the Linker and c\c++ tabs.

    Is it because the computer I use now is a 32-bit machine? Is _M_X64 only visible on 64-bit machines and invisible on 32-bit machine?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width