none
VS2010 calls MSBuild with incorrect environment data

    Question

  • Hi,

    I am using Visual Studio 2010 Express with Windows SDK 7.1 and .NET Framework 4 under Windows 7 Home Premium 64 bit (Sp 1) on a pc with an an Intel Core i7-2600 cpu. When I build a C++ project with build customizations for CUDA from the command prompt with MSBuild, the build succeeds. The logfile shows PROCESSOR_ARCHITECTURE = AMD64 in the environment at start of build. When I build the same project from VS2010, the build fails because some properties are set incorrectly. This can be traced to the fact that PROCESSOR_ARCHITECTURE = x86 in the environment at start of build as shown by the logfile.

    How can I get VS2010 to use the correct value for this and possibly other environent variables?

    Thank you for any help.

    Gun43

    Sunday, January 29, 2012 8:03 PM

All replies

  • Hi Gun43,

    There are two different command prompt, one is for x86 , another is x64. If you use the x64 command prompt the PROCESSOR_ARCHITECTURE=AMD64.

    Similarly, you should select the appropriate platform in the Visual Studio, so please open the Configuration Manager , see whether you select the x64 in the Platform column for your project.

     

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, January 31, 2012 6:05 AM
  • Hi Lucy,

    In Visual Studio I had set Platform to x64 as seen in this excerpt  from the build log.

    10:27:56.605     1>Target "_CheckForInvalidConfigurationAndPlatform: (TargetId:2)" in file "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "D:\Eigene Dateien\AppData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\vectorAdd\vectorAdd_vs2010.vcxproj" (entry point):
                       Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).
                       Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).
                       Using "Message" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
                       Task "Message" (TaskId:2)
                         Configuration=Release (TaskId:2)
                       Done executing task "Message". (TaskId:2)
                       Task "Message" (TaskId:3)
                         Platform=x64 (TaskId:3)
                       Done executing task "Message". (TaskId:3)
                       Task "Error" skipped, due to false condition; ('$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')) was evaluated as ('../../bin/win64/Release/' != '' and !HasTrailingSlash('../../bin/win64/Release/')).
                       Task "Error" skipped, due to false condition; ('$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')) was evaluated as ('obj\' != '' and !HasTrailingSlash('obj\')).
                       Task "Error" skipped, due to false condition; ('$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')) was evaluated as ('x64/Release/' != '' and !HasTrailingSlash('x64/Release/')).
    10:27:56.665     1>Done building target "_CheckForInvalidConfigurationAndPlatform" in project "vectorAdd_vs2010.vcxproj".: (TargetId:2)

    Also, both the x86 and x64 command prompts have PROCESSOR_ARCHITECTURE=AMD64.

    Best Regards,

    Gun43


    Bruce N Gunderson
    • Edited by Gun43 Tuesday, January 31, 2012 2:22 PM more information
    Tuesday, January 31, 2012 9:33 AM