Answered Compilation Error MSB4186 in C++ Samples

  • Saturday, March 17, 2012 10:11 AM
     
     

    I am trying to get the Directx samples to build. Lesson 1 runs without issues, but as soon as there is a shader file in the Project i get the following Error:

    ----

    error MSB4186: Invalid static method invocation syntax: "[MSBuild]::MakeRelative($(OutDir), C:\Users\Reto\Downloads\Windows 8 Consumer Preview Metro style app samples - C#, VB.NET, C++, JavaScript\Metro style 3-D maze game sample\C++\Debug\MarbleMaze\SimplePixelShader.cso)". Method '[MSBuild]::MakeRelative' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)).  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets 470 10 MarbleMaze

    ---

    I have two machines set up with Consumer preview, and the sample code is for Consumer Preview. Did anybody here have this error and was able to fix it?

All Replies

  • Monday, March 19, 2012 7:32 AM
    Moderator
     
     

    Hello,

    I tested Metro style 3-D maze game sample, but cannot reproduce this issue.
    What's your screen resolution of your system. Make sure that it must be larger than 800*600.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

  • Tuesday, April 03, 2012 9:29 AM
     
     

    I have two machines with the same issue, one has been upgraded from Developer Preview (where the samples were working).

    The machines have a display resolution of 1024x768 (Toshiba Laptop) and 1440x900 (Core2Duo Macbook Pro with ATI X1600). The thing is, it's the Shader Compiler that somehow has a problem. If i remove the hlsl files from the project the compilation works. Also i can init DirectX and clear the screen. You should probably forward this to someone who is more into the whole build process. What they do have in common: I upgraded both machines from Developer Preview to Consumer Preview.

  • Wednesday, April 04, 2012 6:17 AM
    Moderator
     
     
    Thanks for your feedback, I will involve more experts to investigate it.
     
    Best regards,
    Jesse

    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

  • Wednesday, April 11, 2012 11:32 PM
     
     Answered

    Hello Reto Senn, this might be a parsing error, but could unpackage the "Metro style 3-D maze game" to a different directory.  I feel that the parser could not handle "Windows 8 Consumer Preview Metro style app samples - C#, VB.NET, C++, JavaScript" correctly.

    Thanks

    Felix

  • Friday, April 13, 2012 3:52 PM
     
     

    Renaming the folder fixed this problem for me.  Everything seems to be building ok now.

    Thanks Mucho,

    FL

  • Wednesday, April 18, 2012 11:43 PM
     
     
    I had this issue on a Virtual Box instance of Windows 8 CP 8250 and the fix was to re-unzip the samples to a new shorter folder....

    Make the web a beautiful place