none
setting cpu target type CLI/C++ RRS feed

  • Question

  •  

    I'm not sure if I'm posting in the correct place, but I have a assembly written in CLI/C++.  Using corflags I'm seeing the following:

     

    Version   : v2.0.50727
    CLR Header: 2.5
    PE        : PE32
    CorFlags  : 8
    ILONLY    : 0
    32BIT     : 0
    Signed    : 1

     

    so if I understand correctly that means anyCPU.  I want it to be for a 32-bit app so I want the 32BIT to equal 1.  I'm not sure how to do this.  In C# I can just change the /platform flag.  In my C++ project I thought I would just need to change the Target Machine (Configuration Properties->Linker->Advanced) but I've tried setting it to MachineX86 (/MACHINE:X86) but I still get the same results.  Am I missing something?

     

     

    Thursday, May 29, 2008 3:44 PM

Answers

  • I already posted to this thread, let's try again.  The C++ linker isn't smart enough to set these flags correctly.  You can use the Corflags.exe utility in a post-build event to force them to the proper setting.
    Hans Passant.
    • Marked as answer by Bruno Yu Tuesday, June 3, 2008 6:40 AM
    Saturday, May 31, 2008 5:35 AM
    Moderator