Not able to run nmake on windows, link given on the body - windows

I am trying to build the source of CURA; (Link: https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Windows). I followed the instructions but got error as below:
PS D:\work\cura-build-environment-master\build> nmake
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.

It looks like you may not have followed all of the instructions, such as this one in the Microsoft Visual Studio 2019 section:
When building files (using cmake or nmake) in the steps below be sure to use the 'VS2015 x64 Native Tools Command Prompt'. This ensures that the Visual Studio 2015 build tools are used.

Related

Running MSVC 'cl.exe' from Git Bash (MINGW64)

I'm trying to find a way to invoke the Visual Studio C++ compiler (MSVC) from within my Git Bash terminal on Windows.
The Developer Command Prompt for VS2017 works fine, it's just annoying to switch between windows just to compile my application.
I tried adding cl.exe to my Path and was unsuccessful. Google keeps pointing me toward using GCC, which I'm not interested in doing. I was also able to find these two questions, both about Cygwin, one about invoking cl.exe and another about importing vcvars32.bat funcationality (They're linked to each other). The issue is that 1) these are for Cygwin, not MINGW64, and 2) point me to vcvars32.bat/VsDevCmd.bat. That script seems to mainly be for setting up the development environment (It also passes all smoke tests invoked by VsDevCmd.bat if that matters.).
So my question(s) is/are:
Is this possible?
How do I resolve bash: cl: command not found and allow calling cl.exe from Git Bash?
Simple workaround: launch your Git Bash terminal from inside a Developer Command Prompt terminal so that it inherits the environment.
Longer (but more flexible): Convert vcvars32.bat to a bash script and source it.
C:\>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.8
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
C:\>f:\git\usr\bin\bash.exe
$ cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]

Get Windows nmake version from command prompt?

I don't really know nmake, but I use nmake from "x64 Native Tools Command Prompt for VS 2017" under Windows 10; I would like to find out the version of this tool from the command prompt.
I have found this:
https://learn.microsoft.com/en-us/cpp/build/reference/batch-mode-rules?view=vs-2019
To check the NMAKE version, run the _NMAKE_VER macro available with NMAKE version 1.62 or higher. This macro returns a string representing the Visual C++ product version.
... but I don't really know how to "run the macro" - I tried this:
C:\>nmake _NMAKE_VER
Microsoft (R) Program Maintenance Utility Version 14.16.27026.1
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1073: don't know how to make '_NMAKE_VER'
Stop.
So, it dropped something like a version string, but there's still an error.
Thus, how can I get the nmake version from the command line properly?
As Hans Passant suggests, you could consider typing nmake/?; this will give you what you already know from your question, namely 14.16.27026.1.
The point of the variable _NMAKE_VER is to allow you to test the nmake version, or the Visual Studio version, from within the makefile. For example, suppose your makefile is:
# Check the first three characters of _NMAKE_VER to
# obtain the Visual Studio version:
!if [cmd /c if "%_NMAKE_VER:~0,3%"=="14." exit 1]
! message Using VS 2017, with NMAKE $(_NMAKE_VER)
!elseif [cmd /c if "%_NMAKE_VER:~0,3%"=="12." exit 1]
! message Using VS 2013, with NMAKE $(_NMAKE_VER)
!else
! message Unknown VS version, with NMAKE $(_NMAKE_VER)
!endif
# Just output _NMAKE_VER:
all:
#echo "Version NMAKE" $(_NMAKE_VER)
Then issuing the following command from the Visual Studio 2017 Developer Command Prompt:
nmake /nologo
will give (on my machine):
Using VS 2017, with NMAKE 14.10.25019.0
Version NMAKE 14.10.25019.0
or for Visual Studio 2013:
Using VS 2013, with NMAKE 12.00.21005.1
Version NMAKE 12.00.21005.1
We need to use the DOS cmd to inspect _NMAKE_VER, as nmake unlike gmake has limited string manipulation tools.
Edit: The above test will probably not be able to distinguish between VS 15 and VS 17, since the VS 17 nmake version number begins with 14 rather than the expected 15.

Error while using msbuild command for sln file

I am trying to build a sln file by using following command
/c/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe "MvcApplication1/MvcApplication1.sln" /t:MvcApplication
It id throwing me following error:
Microsoft (R) Build Engine version 4.7.2053.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: t:MvcApplication
For switch syntax, type "MSBuild /help"
But when i am trying to use the same command without any argument it is building successfully on my default target.
I don't know where it publishing my web and why it is not taking any of the argument.

Building WiX on Visual Studio Team Services times out

I have an existing XAML build I am porting over to Visual Studio Team Services build. There is a Solution file that contains two wixproj projects, and this builds with no issues on the current (legacy XAML) Hosted Build Controller (which uses WiX Toolset v3.7).
In VS TS, I created a new build process and added a step to Build solution using a Visual Studio Build step. I have set the Solution path to my sln that contains the two wixproj projects. All the other options are the defaults except the timeout which is set to 10 minutes.
The build step initiates but times out after calling the Light.exe step, as in the log below:
PrepareForBuild:
Creating directory "obj\Debug\".
Creating directory "bin\Debug\".
Compile:
C:\Program Files (x86)\WiX Toolset v3.10\bin\candle.exe -dDebug ...
Windows Installer XML Toolset Compiler version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
{myfile}.wxs
Link:
C:\Program Files (x86)\WiX Toolset v3.10\bin\Light.exe -out ...
Windows Installer XML Toolset Linker version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
##[error]The task has timed out.
The build will run 10 minutes and then throw a timeout error. It usually takes ~1 minute to finish. There is no information in the log about where this may be timing out or why.
I see that VS TS Build uses WiX version 3.10, but WiX version 3.10 works for me locally to build this same sln. I haveve tried all options for Visual Studio Version in the build step with same results.
Any ideas what I am missing and why this isn't working?
I found a post in the wixtoolset GitHub project documenting a bug in WiX 3.10 about deadlocks occurring with WiX projects if there are any warning or error messages generated during the build.
The workaround is to add the following MSBuild Arguments in the build step:
/p:RunWixToolsOutOfProc=true
This resolved my issue with the Light.exe process timing out.
Files (x86)\WiX Toolset v3.10\bin\candle.exe -dDebug ...
Windows Installer XML Toolset Compiler version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
{myfile}.wxs
Link:
C:\Program Files (x86)\WiX Toolset v3.10\bin\Light.exe -out ...
Windows Installer XML Toolset

OpenCL: Strong name validation failed while creating a new opencl project

This is the OpenCL first tutorial I am following.
I am unable to create new OpenCL project. When I try to create new OpenCL project in visual studio 2010 on windows 7, 64 bit , I get "Strong name validation failed. (Exception from HRESULT: 0x8013141A)" error. And thus it fails to create new project.
Reading some forum says, I have to do some thing with the dll . But I have no idea what is being said.
Some advice is at :http://www.lookout.net/2006/04/bypassing-strong-name-verification-for.html which ask me to do this:
sn -Vr *,36e4ce08b8ecfb17
But what do I put for 36e4ce08b8ecfb17, this is the name of the assembly, but what is the name of the assembly in my case? I am facing this issue at the beginning, when I just try to create New OpenCL project.
Can some one give me a hint specific to OpenCL ?
Then I click OK , and I get this:
What I tried
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>sn -Vl
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly/Strong Name Users
===========================================
*,* All users
iisresolver,B03F5F7F11D50A3A All users
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>sn -Vr * ,B03F5F7F11D50A3
A
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Failed to open registry key -- Unable to format error message 00000005
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>sn -Vr iisresolver , B03F
5F7F11D50A3A
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Failed to open metadata scope on iisresolver -- The system cannot find the file
specified.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>sn -Vr * , *
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Failed to open registry key -- Unable to format error message 00000005
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>
After I used elevated permission of CMD
C:\Windows\system32>sn -Vr * ,B03F5F7F11D50A3A
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Verification entry added for assembly '*,B03F5F7F11D50A3A'
No gain here , so tired this:
C:\Windows\system32>sn -Vr * ,*
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Verification entry added for assembly '*,*'
C:\Windows\system32>
Unfortunately no gain.
this is an annoying issue that can easily be sidestepped for development purposes.
To disable the strong name validating, simply open the visual studio command-line (for example, in Windows 7: Start >> All Programs >> Microsoft Visual Studio 2010 >> Visual Studio Tools >> Visual Studio Command Prompt (2010) )
Then type sn -Vl which will return you a list of all the assemblies registered for strong name validation.
Then type sn -Vr *,idnumberhere to disable the strong name validation for that assembly.
In the case of the error you are receiving ( Failed to open registry key -- Unable to format error message 00000005), this is most often related to permissions: your username may not have the necessary permissions to change strong name validation hence change the permissions on C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA to allow full access to your username as well and all should be fine again:)
Also, ensure that you run the VS command-line with elevated privileges so select Run as Administrator.
Hope this helps. :)
Let me know if you need more information as well though:)
This error is probably due to error Windows Registry try to modify it
or
install Intel or AMD OpenCL SDK on your machine, try to create the project again
or Update the include and library paths of the project to load the required information from the OpenCL SDK installed
I had this same exact problem today, and unfortunately, wasn't able to get it to work using sn.exe.
However, a workaround that worked for me was to just use one of Intel's sample programs as a starting project, and modify it from there. (For example the basic capabilities sample)

Resources