MSBuild compile failed due to C2220 error - visual-c++

Hi I was tend to build a solution which contains multiple projects using MSBuild in command prompt
But I got error C2220
: warning treated as error - no 'object' file generated Driver
I have searched and the whole site and they says
In visual stuido
project -> Properties -> configuration properties -> C/C++ -> disable some options and it works
I open it with VS2017 but there was no such option exists
I just wanna compile it using MSBuild in command prompt by removing /WX compiler option.
Of course, I have read MSBuild option but didn`t find it so I am asking this
is there any command option in MSBuidling removing /WX compiler option?
if not, how to resolve the problem

In the project properties go to:
Configuration properties > C/C++ > General
Select the dropdown next to Treat Warnings As Errors and make a choice.

Related

IntelliJ Haskforce plugin - run error

I installed the Community edition of IntelliJ and the HaskForce Haskell plugin, and I find that:
It does not do any of the context sensitive formatting or auto-completions shown on the demo page,
There is not any obvious simple run configuration for Haskell
and trying to use a default configuration gives the error:
"Error running Pgm: no JDK specified"
Doing a build is successful, and creates a Pgm.exe in the ./dist/build/Pgm directory.
Is there some additional setup or configuration needed?
In your project settings -> Haskell Tools, you haven't specified paths to all executables, in particular ghc-mod and ghc-modi.

Nodejs app fails to run in Nodeclipse

I setup Nodeclipse and wrote a simple hello app. When I try to run as a Node Appplication, I get the following error
Exception occurred executing command line. Cannot run program "node"
(in directory "C:\path\to\app"): CreateProcess error=2, The system
cannot find the file specified
If I run from the Nodejs console, the app runs.
Is there a way I can make it runnable from Nodeclipse?
I know this question is a month old, but I was getting the same error and managed to fix it.
Try going to Window -> Preferences -> Nodeclipse and unchecking the box that says "find node on PATH...". Then make sure the "Node.js path" below is set to the location of the node.exe file (for me it was C:\Program Files (x86)\nodejs\node.exe).
I'm not sure why this worked (I checked my PATH and nodejs is definitely in there), but maybe it will help someone else.
this error is show cause your node.exe is not configured in PATH
simple solution is configure it or use below method
go to windows -> preferences -> nodeclipse
and uncheck the checkbox (find node on PATH)
it works
Do you have Node.js installed? What is path to it?
Check Window -> Preferences -> Nodeclipse and compare.
http://www.nodeclipse.org/#support have also other option to follow with
Quote:
How do I? -- 1) F1/Help -> Help Contens -> Nodeclipse Help ,
2) Online Help or
3) StackOverflow! *1
*1 Don't forget to add `nodeclipse` tag.
I got this error, why? -- StackOverflow! *1
I got this error and I'm sure it's a bug -- raise an issue!
Should you report a bug, please include the following:
Nodeclipse version number (like 0.4 or 0.8)
Eclipse version number (like 4.3.1 Kepler or 4.4.0)
Eclipse distribution (e.g. Eclipse for Java EE Developers)
A detailed description of the steps necessary to reproduce the problem.
Screenshot and stack trace, that you can get from Eclipse Error Log View (Window -> Show View ...)
or from '.log' file from the directory '.metadata' in your workspace.
See example issue #78
After you install node.js plugin in eclipse, then go to https://nodejs.org/en/ official website, and install v4.2.6 LTS open source libraries, after double click install, then restart eclipse, then done!
in system Path variable -nodejs would be mentioned as
C:\Program Files\nodejs\
whereas we need to include node.exe i.e C:\Program Files\nodejs\node.exe
So either we can
uncheck the checkbox "find node on PATH.Otherwise use Node.js instance in location below.
or
add the node.exe in system path variable.
Added IDE image (1 option) so that its easily to fix.
Same here, I restarted Eclipse and it worked ok.
Eclipse loads variable PATH when started - in my case I installed Nodejs when executing Eclipse.
In addition to Jordan's answer above (configure Node.js path) I also needed to configure the Javascript runtime library with a Node.js runtime before being able to "Run As" a "Node.js Application" and point to the node.exe path. The same path as the separate Node.js path Jordan mentioned.
Preferences > JavaScript > Runtimes > [select Node.js Runtime] > Add : path to node.exe

CMAKE, NMAKE makefiles - 'compiler cl not found' (but VS 12 generator succeeds)

The VS environment variable is set beforehand with vcvars32.bat, and VS is the only compiler that I use; the OS is win 7.
The error happens with cmake-gui; specifying the compiler with path results in error 'compiler failed to make simple test'; alternatively, cmake -i from command line succeeds initially with presenting an 'options' menu which then fails to allocate a 'cmakelists.txt' file (which is somewhere deeper in the cmake folder).
Where am I going wrong?
(I continued with building the solution files from VS 12, but there's other issues.)
The answer to your question from cmake mailing list
Run cmake-gui FROM the target environment, just like you run cmake...
i.e. : type "cmake-gui" in the cmd prompt that has your stuff set up
in it. Don't just launch it from a short-cut unless you're using the
"Visual Studio *" generators. Those do not need any special
environment. Many of the makefile ones do.

Visual Studio 2012 Command Line Building - Detecting Build Failures

I'm setting up a build server for a Visual Studio 2012 project and I'm trying to add detection for failed builds so the server can properly recover after a build failure and notify users of the failure and the error message.
I'm using devenv.exe with the "/Build" and "/Out" switches, however for building, the "/Out" switch captures all build output and stores in the specified file, and I only want it to capture build errors.
Does anyone have any suggestions on how I can only have build errors written to the file, or better ways of detecting a build failure?
Thank you in advance!
If you just need a pass/fail, you could use ERRORLEVEL in a batch/cmd script. It's primitive, but would probably work for most cases. Something like this:
#devenv Solution.sln /Build
#if ERRORLEVEL 1 echo Build Failed
You could also use MSBuild, which has options for console output (i.e. /clp:ErrorsOnly) as well as file output. Something like this:
msbuild /p:Configuration=Debug /t:Rebuild /clp:ErrorsOnly Solution.sln

fatal error C1083: Cannot open include file: 'Windows.h': and scons

Today is officially my first day with C++ :P
I've downloaded Visual C++ 2005 Express Edition and Microsoft Platform SDK for Windows Server 2003 SP1, because I want to get my hands on the open source Enso Project.
So, after installing scons I went to the console and tried to compile it using scons, but I got this error:
C:\oreyes\apps\enso\enso-read-only\src\platform\win32\Include\WinSdk.h(64) : fatal error C1083: Cannot open include file: 'Windows.h': No such file or directory
scons: *** [src\platform\win32\InputManager\AsyncEventProcessorRegistry.obj] Error 2
scons: building terminated because of errors.
After checking these links:
VS ans PSDK
Include tiffi.h
Wndows.h
I've managed to configure my installation like this:
And even run this script
And I managed to compile the file below in the IDE.
// Test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
But I still get that exception in the console. Does anyone have scons experience?
EDIT
Actually (and I forgot to tell you this) I started the command prompt with the link "Visual Studio 2005 Command Prompt".
I assume this will include the paths in environment variables. Well after printing them I find that it didn't:
echo %INCLUDE%
echo %LIB%
echo %PATH%
And they were not present, so I created this .bat file:
set PATH=%PATH%;"C:\Program Files\Microsoft Platform SDK\Bin"
set INCLUDE=%INCLUDE%;"C:\ Program Files\Microsoft Platform SDK\Include"
set LIB=%LIB%;"C:\ Program Files\Microsoft Platform SDK\Lib"
Still, scons seeems not to take the vars... :(
Using the above recommendations will not work with scons: scons does not import the user environment (PATH and other variables). The fundamental problem is that scons does not handle recent versions of SDKs/VS .
I am an occasional contributor to scons, and am working on this feature ATM. Hopefully, it will be included soon in scons, but the feature is much harder to implement reliably than I first expected, partly because every sdk/compiler combination is different (and sometimes even MS does not get it right, some of their .bat files are broken), so I can't give you a date. I hope it will be included in 1.2 (to be released in approximatively one month).
You need to set the include file path (and possibly other things). At the command line this is typically done using a batch file that Visual Studio installs called vsvars32.bat (or vcvars32.bat for compatibility with VC6).
I'm not familiar with scons so I don't know the best way to get these settings configured for that tool, but for standard makefiles there's usually a line in the makefile which sets a macro variable with the include directory path and that macro is used as part of a command line parameter in the command that invokes the compiler.
Another possibility might be to have the scons process invoke vsvars32.bat or run the scons script from a command line that has been configured with the batch file.
In short you need to get the things that vsvars32.bat configures into the scons configuration somehow.
There will be a batch file similar to this one (for MSVC 2005) that sets up the environment variables:
c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat
Step 1: Find a similar file in the Express installation folders
Step 2: Create a shortcut on the desktop with these target details and a suitably modified path:
cmd.exe /K "c:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
Step 3: Open the DOS prompt via this shortcut
The command line build should now work from within this console window.
You show us how you configured Visual Studio for compilations within Visual Studio but you didn't show us what command line environment you tried. Sorry I haven't tried Express versions so I don't know if they create additional Start menu shortcuts like Pro and above do. If you open a suitable command prompt with its environment variables already set then you can compile on the command line. Otherwise you have to set variables yourself or execute a batch script to set them, each time you open a command prompt.
It'll be nice when scons does this automatically. For now, I use this (run from an SDK command prompt, not sure if there is a difference if run after vsvars32.bat):
import os
env = Environment(ENV={'PATH': os.environ['PATH']})
env['ENV']['TMP'] = os.environ['TMP']
env.AppendUnique(CPPPATH=os.environ['INCLUDE'].split(';'))
env.AppendUnique(LIBPATH=os.environ['LIB'].split(';'))
This works for me while compiling wxwidgets with Visual C++ 2005 Express using the command line prompt:
REM Fix Error error C1083 'windows.h'
(Use /useenv option when compiling.)
set PDSKWIN=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
(Change to the right one.)
set INCLUDE=%PDSKWIN%\Include;%INCLUDE%
set LIB=%PDSKWIN%\Lib;%LIB%
Then I use this line when compiling. I believe just add /useenv to your lines and everything should work fine:
vcbuild /useenv /nohtmllog /nologo name.proj (or any file to compile)

Resources