When I build my new project in .Net Core VS2019 the build gets failed with an error. The project have some css and js files which uses typescript that cause this error. But I don't know what went wrong or what might be the cause of it.
I tried installing and unistalling the latest and old version of typescript and also installed the node.JS
The detailed output I get when I build is :
Task "VsTsc"
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe "C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js" --project "D:\Piccolo.Admin\Piccolo.Admin\wwwroot\assets\vendors\general\summernote\tsconfig.json" --listEmittedFiles --locale en-US
1> Unknown output: throw e;
1> Unknown output: ^
1> Unknown output: at Object.createNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:16472:20)
1> Unknown output: at createSynthesizedNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:60303:23)
1> Unknown output: at Object.createTypeQueryNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:60891:20)
1> Unknown output: at symbolToTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34983:31)
1> Unknown output: at createAnonymousTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34315:36)
1> Unknown output: at typeToTypeNodeHelper (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34251:28)
1> Unknown output: at C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34042:106
1> Unknown output: at withContext (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34083:37)
1> Unknown output: at Object.typeToTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34042:28)
1> Unknown output: at typeToString (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34021:40)
1> C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\build\Microsoft.TypeScript.targets(462,5): error MSB6006: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe" exited with code 1.
1> Done executing task "VsTsc" -- FAILED.
I have the same error when I want to publish my project
C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.7\build\Microsoft.TypeScript.targets(463,5): error MSB6006: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe" exited with code 1.
I set "MSBuild project build output verbosity" to "Detailed" in "Tools->Options->Projects and Solutions->Build and Run" and I see VS want to compile several .ts files and can't do that.
this is my .ts files can't compile
4>Target "CompileTypeScript" skipped, due to false condition; ('$(BuildingProject)' != 'false' AND '#(ConfigFiles)' == '' AND '#(TypeScriptCompile)' != '' AND '$(DesignTimeBuild)' != 'true') was evaluated as ('true' != 'false' AND 'App_Themes\Dashboard\Vendors\summernote\tsconfig.json' == '' AND 'App_Themes\Dashboard\Vendors\handlebars\lib\handlebars.d.ts;App_Themes\Dashboard\Vendors\moment\moment.d.ts;App_Themes\Dashboard\Vendors\perfect-scrollbar\types\perfect-scrollbar.d.ts;App_Themes\Dashboard\Vendors\popper.js\index.d.ts;App_Themes\Dashboard\Vendors\sweetalert2\sweetalert2.d.ts;App_Themes\Dashboard\Vendors\tooltip.js\index.d.ts;Scripts\index.d.ts' != '' AND '' != 'true').
I exclude these files and successfully published my project
you can exclude .ts file(s) from your project or modify and try again
In my case, I've Changed the ECMAScript to project requirements.
Best regards.
exclude node_modules folder from the project when you publish it
Related
The errors might be showing because of the internal thing I had created and defined as static
here is the build ouput
1>------ Build started: Project: C++_Game_Stuff, Configuration: Debug Win32 ------
1>win64_maybe32_idk_platform.cpp
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xiosbase(41,1): error C2159:
more than one storage class specified
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xiosbase(93): message : see
reference to class template instantiation 'std::_Iosb<_Dummy>' being compiled
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xiosbase(41,43): error C2059:
syntax error: '='
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xiosbase(41,1): error C2238:
unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xiosbase(112,56): error C2589:
'static': illegal token on right side of '::'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xiosbase(112,1): error C2062:
type 'unknown-type' unexpected
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xlocnum(1439,73): error C2589:
'static': illegal token on right side of '::'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xlocnum(1555): message : see
reference to class template instantiation 'std::num_put<_Elem,_OutIt>' being compiled
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xlocnum(1522,73): error C2589:
'static': illegal token on right side of '::'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\ios(216,45): error C2059: syntax
error: 'type'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\ios(216,66): error C2143: syntax
error: missing ';' before '{'
1>C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\ios(216,66): error C2447: '{':
missing function header (old-style formal list?)
1>C:\Users\maazs\source\repos\C++_Game_Stuff\C++_Game_Stuff\win64_maybe32_idk_platform.cpp(71,5): warning C4007: 'WinMain': must be '__stdcall'
1>Done building project "C++_Game_Stuff.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The rest of the code is just warnings about int to float conversions:
I am not to skilled in programming and I am also following a tutorial however though I believe I had defined a macro variable for the static keyword called #define internal static however this had caused errors due to the files I was talking about(Xiobase, xlocnum, io) containing a keyword named internal thus causing errors because of the two variables with different meaning having the same name the program was confused.
I have recently download Net-SNMP code from their website and trying to build in VC 2017 - and it fails.
The extracted folder has win32.dsp and win32dll.dsp - when I try to open in VC IDE I get error like -
Message
snmptrapd\snmptrapd.dsp: Unable to convert project. Please make sure this is a valid Visual C++ 6.0 project.
snmptrapd\snmptrapd.dsp: Project upgrade failed.
snmptrapd\snmptrapd.dsp: Converting project file 'C:\tools\netsnmp\net-snmp-5.8\win32\snmptrapd\snmptrapd.dsp'.
Hide 1 additional messages
Almost for all projects - the build via command line 'nmake' utility also fails with below error -
cd libagent
nmake /nologo all
cl.exe /I.. /I..\..\include /I..\..\agent\mibgroup /D WIN32 /D _BIND_TO_CURRENT_VCLIBS_VERSION /D _CONSOLE /D _CRT_NONSTDC_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D _MBCS /D _WINSOCK_DEPRECATED_NO_WARNINGS /EHsc /FD /FR.\release\ /Fd.\release\libagent.pdb /Fo.\release\ /I C:\OpenSSL-Win32\include /c /W3 /Zi /nologo /wd4244 /wd4267 /MD /D NDEBUG /O2 ..\..\agent\agent_handler.c ..\..\agent\agent_index.c ..\..\agent\agent_read_config.c ..\..\agent\agent_registry.c ..\..\agent\agent_sysORTable.c ..\..\agent\agent_trap.c ..\..\agent\snmp_agent.c ..\..\agent\snmp_vars.c
agent_handler.c
..\..\agent\agent_handler.c(19): fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory
agent_index.c
..\..\agent\agent_index.c(12): fatal error C1083: Cannot open include file: 'signal.h': No such file or directory
agent_read_config.c
..\..\agent\agent_read_config.c(16): fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory
agent_registry.c
..\..\agent\agent_registry.c(32): fatal error C1083: Cannot open include file: 'signal.h': No such file or directory
agent_sysORTable.c
..\..\agent\agent_sysORTable.c(3): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
agent_trap.c
..\..\agent\agent_trap.c(35): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
snmp_agent.c
..\..\agent\snmp_agent.c(50): fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory
snmp_vars.c
..\..\agent\snmp_vars.c(68): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\cl.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\nmake.EXE"' : return code '0x2'
Stop.
How can we resolve the issue?
If you built with OpenSSL you may have set INCLUDE and LIB paths and replaced the ones set by vcvars. If you set INCLUDE and LIB before running vcvars it will probably work. I concatenated to them to fix the issue.
I can't build directly from VS2017 neither.
According to the file README.win32, install ActivePerl first, then run win32\build.bat.
Updated: I have just push a branch that fixed compilation issue. Have a look at this: https://github.com/sanbrother/net-snmp/tree/VS2017/v5.8
(solution file net-snmp\win32\win32dll.sln)
PS: It seems that, old version (may be before 5.7.3???) has no such problems. New code split some files into multiple ones, and caused compilation issue under Windows.
I was playing with VS2019 and found out that it works with clang. So I installed clang and I've been having some issues with it working with VS2019. However, this issue is only based on the compiler. Seems that if I were to compile with the command line:
C:\Program Files\LLVM\msbuild-bin\cl.exe /std:c++17 source.cpp
Where source.cpp contains:
#include <tuple>
#include <iostream>
void fn(int x)
{
std::cout << x << std::endl;
}
int main()
{
std::tuple<int> x(1);
apply(fn, x);
return 0;
}
It barfs up:
clang-cl.exe: warning: argument unused during compilation: '/std:c++17' [-Wunused-command-line-argument]
In file included from source.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.20.27508\include\tuple:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.20.27508\include\new:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.20.27508\include\exception:7:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.20.27508\include\yvals.h:7:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.20.27508\include\yvals_core.h(334,2): error: STL1000: Unexpected compiler version, expected Clang 7 or newer.
#error STL1000: Unexpected compiler version, expected Clang 7 or newer.
^
source.cpp(12,3): error: use of undeclared identifier 'apply'
apply(fn, x);
^
2 errors generated.
However, if I use:
"C:\Program Files\LLVM\bin\clang-cl" /std:c++17 source.cpp
All is well.
Thing is, VS2019 is using the former compiler executable. How do I get it to use the latter?
The only thing I did to change the builder was to go and change this item:
Is there anything else I am to be changing?
I recently created a VS2015 solution to continue development on a C++ project I had been working on. Whenever I try to build the project, I get hundreds of errors from standard C library header files such as string.h, stdio.h, etc.
To try to get to the root of the problem, I created a new, very basic, VC++ win32 console application project, wondering if I'd see the same compiler errors. Here is the code (ConsoleApplication1.cpp):
#include <string>
#include <iostream>
int main()
{
std::string s = "some data to print...";
std::cout << "Printing: " << s.c_str() << std::endl;
return 0;
}
When I attempt to compile this, I get 150+ errors, like this:
1>------ Build started: Project: ConsoleApplication1, Configuration: Release Win32 ------
1> stdafx.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(309): error C2144: syntax error: 'int' should be preceded by ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(309): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(311): error C2144: syntax error: 'int' should be preceded by ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(311): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(311): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(309): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(317): error C2144: syntax error: 'int' should be preceded by ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(317): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(317): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(309): note: see declaration of '_CRTIMP_ALTERNATIVE'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(320): error C2144: syntax error: 'int' should be preceded by ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(320): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(320): error C2086: 'int _CRTIMP_ALTERNATIVE': redefinition
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdio.h(309): note: see declaration of '_CRTIMP_ALTERNATIVE'
....etc
I have tried to 'repair' Microsoft VC++ 2015 Redistributable(x86) via the Windows 'Uninstall or change a program' utility, to no avail. I also tried to repair Visual Studio 2015 as a whole.
I'm on Windows 7.
Anyone have an idea what is going on here? Am I pointed to the wrong include directory or something?
It appears you have (some of) the headers from a previous version of VS installed in your VS2015 folder. The standard headers in VS2015 are stored off in a folder tied to the version of the CRT (something like c:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt). Repairing or reinstalling VS2015 won't fix this.
I think you'll need to uninstall VS2015, completely delete the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0, then reinstall it. This will likely break the other version (VS2013?) that is installed there, so you might want/need to uninstall that version instead, then repair VS2015.
The header that comes with VS2015 does not appear to have the "int _CRTIMP_ALTERNATIVE" listed in some of the error messages at those lines, while the one with VS2013 does.
I am building a COM dll using Visual Studio 2015 and started getting debug assert messages when the module is unregistered using regsvr32. I am perplexed by this, have never had a problem with the rgs files.
Here is the rgs file (looks pretty standard to me):
HKCR
{
NoRemove CLSID
{
ForceRemove {36A078F3-BCD2-4777-B8E7-1AE96313113E} = s 'PropertyHandler Class'
{
ForceRemove Programmable
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Both'
}
TypeLib = s '{D76FE9E8-1C33-4616-8F61-9E1C734843D9}'
Version = s '1.0'
}
}
}
Here is the debug output when running regsvr32 /u against the dll:
c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\statreg.h(1634) : atlTraceRegistrar - Deleting Key Programmable
c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\statreg.h(1634) : atlTraceRegistrar - Deleting Key InprocServer32
c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\statreg.h(1634) : atlTraceRegistrar - Deleting Key TypeLib
c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\statreg.h(1634) : atlTraceRegistrar - Deleting Key Version
c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\statreg.h(1634) : atlTraceRegistrar - Deleting Key {36A078F3-BCD2-4777-B8E7-1AE96313113E}
c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\statreg.h(1118) : atlTraceRegistrar - Should not be here!!
Debug Assertion Failed!
Here's what's in the registry under that key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{36A078F3-BCD2-4777-B8E7-1AE96313113E}]
#="PropertyHandler Class"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{36A078F3-BCD2-4777-B8E7-1AE96313113E}\InprocServer32]
#="[path to dll]"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{36A078F3-BCD2-4777-B8E7-1AE96313113E}\Programmable]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{36A078F3-BCD2-4777-B8E7-1AE96313113E}\TypeLib]
#="{D76FE9E8-1C33-4616-8F61-9E1C734843D9}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{36A078F3-BCD2-4777-B8E7-1AE96313113E}\Version]
#="1.0"
This project has 3 rgs files (one for each class) and all 3 are generating these debug asserts. Anyone seen this before?