locked
Compilation Error MSB4186 in C++ Samples

    Question

  • 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?

    Saturday, March 17, 2012 10:11 AM

Answers

  • 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

    Wednesday, April 11, 2012 11:32 PM

All replies

  • 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

    Monday, March 19, 2012 7:32 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.

    Tuesday, April 3, 2012 9:29 AM
  • 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 4, 2012 6:17 AM
  • 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

    Wednesday, April 11, 2012 11:32 PM
  • Renaming the folder fixed this problem for me.  Everything seems to be building ok now.

    Thanks Mucho,

    FL

    Friday, April 13, 2012 3:52 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

    Wednesday, April 18, 2012 11:43 PM
  • I can't remember which, but either the '+' or ',' in the path causes problems with MS Build. 

    Joel Ivory Johnson | http://www.j2i.net | Windows Phone Developer MVP
    It takes all the running you can do to stay in one place.If you want to get somewhere else,you must try to run at least twice as fast as that.

    Saturday, June 22, 2013 1:42 AM
  • All I had to do was rename the directory C#,C++ to CsharpAndCPlusPlus and it all started working.

    Matt Daley

    Saturday, March 29, 2014 4:33 PM