TRACKER : error TRK0005: Failed to locate: "xsd.exe". The system cannot find the file specified - c++

In the intent of converting a Microsoft Visual Studio 2015 (VS2015) project with VisualGDB to VS2017 without VisualGDB, I get the following error:
Notes: VS2017 includes a native feature for remote build/debugging.
TRACKER : error TRK0005: Failed to locate: "xsd.exe". The system cannot find the file specified.
Why is that happening and how to solve it?
More details
Opening the project with VS2017 and going to the properties, most of the required settings for remote build are missing. I tried to add/modify the ``.vcxproj` xml to match an new empty project which seem to build correctly remotely.
After this step, the property window of the project seem pretty similar, except an additional XML Data generator Tool section in the not-working project.
When building the project, it shows the following:
1>------ Rebuild All started: Project: project, Configuration: Debug x64 ------
1>Cleaning remote project directory
1>TRACKER : error TRK0005: Failed to locate: "xsd.exe". The system cannot find the file specified.
1>
1>
1>Done building project "project.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
EDITED: it seem related with the inclusion of some sources like:
<Xsd Include="C:\Users\...\xml_file.xsd" />

I just faced the same issue and resolved it through a combination of the following two steps:
Locating xsd.exe on my file system. If it doesn't exist (although it should when Visual Studio is installed), this answer might help.
Adding the path it is in to the "Executable Directories" variable in the properties of the Visual Studio project. (Personally, I don't have Visual Studio installed, so I added <ExecutablePath> properties next to the <IncludePath> ones in the .vcxproj file via text editor)

Related

Cannot build console application with Microsoft Visual Studio 2019

I just installed the community version of VS 2019. I selected to build a console application that it created for me ("hello world" program). The file created is called ConsoleApplication1.cpp. I went to the build menu, selected build, and get the following error:
1>------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(441,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found.
1>ConsoleApplication1.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\yvals.h(12,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
1>Done building project "ConsoleApplication1.vcxproj" -- FAILED.
I tried to follow directions listed elsewhere on stackexchange. When I select "Project -> Properties" the Windows SDK field is blank. A value I typed in from the other StackExchange message creates an error that that version of the SDK cannot be found. So I deleted the version of the SDK and made it blank again. I also tried using "10.0" Here is where I received the advice:
Visual Studio 2017 errors on standard headers
Perhaps I did not install all the needed components. I recently checked off: "Windows Universal CRT SDK" (as per the instructions), but the build still fails. The warning is interesting. I looked that up also but have not found a solution that works. My "Platform Toolset" is Visual Studio 2019 (v142).
What might still be missing to build a console application? Thank you. I am working on Windows 7.

Fatal error LNK1104: cannot open file 'sfml-system-s-d.lib'

I'am getting an error shown below, I'am using visual studio 2017 community and I'am trying to run a project I downloaded from github.
1>------ Build started: Project: CurveFever, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'sfml-system-s-d.lib'
1>Done building project "CurveFever.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
So far I have already uninstalled Visual Studio 2017 and re installing it again, I have already tried searching for questions similar to mine and what I found did not work. I have already checked whether sfml-system-s-d.lib is in the directory of my SFML folder and its in there.
Your linker seem not to be able to find 'sfml-system-s-d.lib'
You have to add the path to the library to the linker options:
Right-klick on your project->Properties->Linker->Additional Library Directories
Write the path to the folder containing your library, e.g. c:\lib\

Visual Studio unable to recognise my MFC library for my webcam laser rangefinder code

I tried copying the source code from the internet directly and I couldn't build/debug the whole file because of the error found below.
Please Help
Error occurred while restoring NuGet packages: System.ArgumentException: The path is not of a legal form. at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength,Boolean expandShortPaths)
at System.IO.Path.GetDirectoryName(String path)
at NuGet.VisualStudio.VsUtility.GetNuGetSolutionFolder(Solution solution)
at NuGet.VsEvents.PackageRestorer.UsingOldPackageRestore(Solution solution)
at NuGet.VsEvents.PackageRestorer.BuildEvents_OnBuildBegin(vsBuildScope Scope, vsBuildAction Action).
1>------ Build started: Project: LaserRange, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(369,5): error MSB8031: Building an MFC project for a non-Unicode character set is deprecated. You must change the project property to Unicode or download an additional library. See http://go.microsoft.com/fwlink/p/?LinkId=286820 for more information.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========}
Question : Where do I "change the project property to Unicode"?
Answer :
For C++,
Right Click the project, and select properties, ( or Alt-Enter )
Property Pages should open
Under Configuration Properties
General
[-]Project Defaults
**Character Set** : Use Multi-Byte Character Set
- Change to -
**Character Set** : Use Unicode Character Set
Pain in the butt to find it.
right click your solution, go to properties and set the project properties to use Unicode instead.
you need to install MFC MBCS DLL Add-on As mentioned in your error.
See the below link
http://msdn.microsoft.com/library/dn251007.aspx
I encountered the same issue while building solution in Visual Studio and it got resolved when installed below components:
MFC for C++
Common tools for C++
Windows 8.1 SDK and universal CRT SDK

Visual Studio error: LNK1104: cannot open file 'kernel32.lib' - only in WP8 projects / Win32 builds

I ran into this problem recently (few days ago everything was working fine): Visual Studio 2012 started to refuse to build native WP8 projects.
Today, I created new solution from template 'Windows Phone Direct3D App (Native Only)' to check if my newly created DLLs will be properly supported on WP. I tried to compile this project, first without any changes or additional references - pure code generated by VS. However, it failed with given error.
I know very well what does it mean and what could be the possible reason, but I can't understand, hovewer, where does it come from in this case.
Weird thing: this only happens in 'Win32' configuration, ARM compiles fine:
1>------ Build started: Project: PhoneDirect3DApp, Configuration: Debug ARM ------
.......
Build Summary
-------------
00:11.742 - Success - Debug ARM - PhoneDirect3DApp\PhoneDirect3DApp.vcxproj
but Win32 does not:
1>------ Build started: Project: PhoneDirect3DApp, Configuration: Debug Win32 ------
.......
1>LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
Build Summary
-------------
00:09.725 - Failed - Debug Win32 - PhoneDirect3DApp\PhoneDirect3DApp.vcxproj
My standard (native C++/Win32) projects also work as expected (in both Win32 and x64 platform targets).
Project configuration: (in both platforms)
Linker::Input:
d3d11.lib;%(AdditionalDependencies)
Linker::Ignore:
ole32.lib;%(IgnoreSpecificDefaultLibraries)
VC++ Directories:
Microsoft.ARM.Cpp.User:
$(WP80ToolSetPath)lib\arm;$(WindowsSDK_LibraryPath_ARM);
Microsoft.Win32.Cpp.User:
$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WP80ToolSetPath)lib\x86;$(WindowsSDK_LibraryPath_x86)
Any ideas what else could be wrong or configured incorrectly? I'm running out of ideas, I have never seen something like this before.
By the way, I have noticed one more change: when I was trying to compile WP8 projects in ARM configurtion before, there was always an error, saying "building ARM application on desktop is not supported" (or something like that). Now ARM compiles with no problem. Is it normal?
Finally, I have found the reason of my problems: as I suspected, internal Visual Studio configuration has been broken.
I did all standard steps, that can be performed in case of LNK1104, however:
- kernel32.lib was in valid location
- all include and library directories was correct
- standard *.props files were attached to each project
However, the cause was lying elsewhere.
All paths are defined using standard macros. One of them is $(WindowsSDK80Path), which is used to build include/library paths. On my system, this macro was defined as
C:\Program Files (x86)\Windows Phone Kits\8.0
instead of
C:\Program Files (x86)\Windows Kits\8.0
And that's it. I do not know, when or how, this problem arosed. Visual Studio repair via orginal installer was sufficient method to fix everything. All projects compile now without any problems.

After upgraded from VS2008, build project in VS2012 shows error

Our team is migrating whole baseline from VS2008 to VS2012. There're over 400 C++ projects. There're 6 C++ project show wired error, such as :
1>------ Rebuild All started: Project: SSLT, Configuration: Release Win32 ------
1> stdafx.cpp
1> ???
1>c1xx : fatal error C1083: Cannot open source file: '???': No such file or directory
1> ??????????????????????????????
1>c1xx : fatal error C1083: Cannot open source file: '??????????????????????????????': No such file or directory
All files which are the parameters of cl.exe seems in wrong encoding, and cl.exe can't find them.
Firstly, i think it must be encode issues of .vcxproj, so i save as other encoding style. But still happens.
Then i re-upgrade these projects with such issue, but always build error.
At last, I change the project platform toolset back to VS2008, then build pass. So i think it's not because project file encode format. I don't know what wrong with them when using 2012 compiler. These projects build no error using 2008 compiler. And as i know from VS2010, project format changed a lot, so i can't find any clue.
Btw, there's another reason cause such issue. After upgrade, there's one property in *.vcxproj file made an unproper line break, such as:
/Zm300
/bigobj %(AdditionalOptions)
if i change it back to:
/Zm300 /bigobj %(AdditionalOptions)
Then works well, build pass.
The projects which has such issue, 80% of them are because of such issue.
Create a new sample project to see which encoding the VS expects and then convert your files to it.
Alternatively, How to: Upgrade Visual C++ Projects to Visual Studio 2012 says that you must upgrade a VS2008 project upon opening it in VS2012.
I don't have a VS2012 installation to check this, but there may be a function to convert a project programmatically in one of its DLLs - try searching with a dumpbin-based script or by examining stack traces with procmon while converting a sample project.
Thanks for your reply, i automatically upgrade our projects using: devenv.exe /upgrade *.vcproj in script.
Today i find the root cause is precompile header file: stdafx.h.
It is because that wrong precompiling head file reference. It will cause mess file name issue.