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

    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)");
    #endif

    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. http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx ).

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

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    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
    Posts
    375

    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

Featured