c++ project, vs2010, "build failed" with no errors - c++

I am trying to create a new c++ cli project in visual studio 2010.
After i create the new project, i try to build it, and get "build failed" message, with no errors, or other description of what went wrong
1>------ Build started: Project: TestProject3, Configuration: Debug Win32 ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I am working on windows 7, 64 bit.
This is happening also if i try to create the project with another template (like win32 console application).
I tried to create the project under "c:\Test", to make sure that the problem is not with the folder's path, or write permissions.
This solution also contains a c# project, that is working with no problems.
Does anyone know this problem? do i need to change something in the project properties?
Thanks in advance :)
Amir

Did you include any source files to be built? It would seem natural that compilation fails without any errors only when there are no source files (included for build) or they are empty, perhaps.

Related

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

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)

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

1 up-to-date issue with VisualStudio 2010 and Visual studio 2012

I am trying to generate an .exe using visual studio 2010, for the first it builds fine but if i delete the .exe and again if try to build without making any changes in file for the second time, its not generating the .exe again and it is just showing as follows even if the .exe is not present,
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
On searching the internet, i found it may be possible to build again, by everytime using "rebuild" option of VS2010. But i dont want to use rebuild option as i am generating .exe via command prompt always using something like devenv /build "Debug|x64".....
I also Tried to build using Visual Studio 2012 and still facing the same problem for 2nd time generation.
Please suggest me with a solution. I am trying from two weeks and found no solution(except "rebuild" option) which works fine with this issue.
Project Properties -> Build Events -> Post-Build Events -> Command Line:
del /F /Q "$(IntDir)\$(MSBuildProjectName).lastbuildstate"
This will delete lastbuildstate file after every build, so .exe file will be regenerated every time.
Right click on the name of the project in the Solution Explorer window and then "Rebuild"

Visual Studio 2010 Randomly Stops Building

I am having a problem with Visual Studio 2010 as of late that I can't figure out. Lately after having VS2010 open for an extended period of time, building begins to fail without error. This includes build, rebuild, and clean.
The output from VS2010 is only two lines:
When trying build:
1>------ Build started: Project: example, Configuration: Debug Win32 ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
When trying rebuild:
1>------ Rebuild All started: Project: example, Configuration: Debug Win32 ------
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
When trying clean:
1>------ Clean started: Project: example, Configuration: Debug Win32 ------
========== Clean: 0 succeeded, 1 failed, 0 skipped ==========
The only way I can resume using VS to build the project(s) is to restart my system. However, using msbuild from the commandline builds the project(s) without issue. So this appears to be related to VS itself but I can't figure out whats causing it with no actual error being displayed.
I have tried restarting VS itself, deleting .suo, .ncb, precompiled headers, etc. to see if it is a file lock issue which did not help or fix the problem. There are no stray processes running from a previous build when this starts happening either.
Edit --8<------------------------------------------
Just for some added information:
I have reinstalled VS2010 twice to try to correct this.
I have reinstalled VS2010 SP1 twice along with that.
This only happens with VS after an extended period of time.
It seems to occur when modifying a header (C++) file for a long time.
After it happens I can still build from the command line fine just not from VS until I restart the system.
If it started suddenly, keeps happening, and happens on different projects, try testing your RAM. You can download an ISO for memtest86, burn, and boot to it.
I know this is old but try rebuilding and cleaning solution if this happens to you again. It helped me.
A bit late to respond to this but I never did figure out what caused this issue to happen. I landed up reformatting shortly after I posted this question. Thanks all who tried to help though.

CUDA + Visual Studio = suppressed output window

Normally, when I use Visual Studio to do a build, I see warnings and errors shown in the output pane, e.g.
1>------ Build started: Project: pdcuda, Configuration: Release x64 ------
Compiling...
foo.cpp
Linking...
foo.obj : error LNK2001: unresolved external symbol "foo"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm doing some GPU programming with CUDA. Upon upgrading to 2.1, I no longer get any useful output in Visual Studio. For example, all I now see is:
1>------ Build started: Project: pdcuda, Configuration: Release x64 ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The other details can be found in BuildLog.htm, but it's inconvenient to hunt that file down all the time.
Does anyone know how to force Visual Studio to show the output in its output pane?
Things that don't help:
uninstalling CUDA: the problem persists in all projects
Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity: changing this pulldown, even to "Diagnostic" has no discernable effect.
EDIT: Additional things that don't help:
devenv.exe /resetsettings
devenv.exe /resetuserdata
UPDATE (in response to Die in Sente): It's now working on one of the two machines (I'm not sure what I did to fix it though). The machine that's still having problems has a CUDA Visual Studio Wizard installed that has caused similar problems before. The still-broken machine had version 15.00.21022.8 of the compiler. The working machine has 15.00.30729.1. After making a backup, I transferred "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64" from the working to the broken machine. I observe no changes in behavior on the broken machine.
I have exactly the same problem, but without CUDA. Today Visual Studio just decided it wasn't going to show any build messages anymore. It was working fine, then one of my builds it just stopped working. The problem persists over all my projects now, and persists over reboots. I also see the correct messages in buildlog.htm. This is ridonkulous!
EDIT: Ooh, I used the add/remove programs to do a repair, and now it works again! Yeah!
did you tried to reset IDE
devenv.exe /resetsettings
or
devenv.exe /resetuserdata
I also recently install CUDA 2.1 (on top of 2.0 I believe). The default installation for CUDA 2.1 moved the SDK from
C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\
to
C:\Documents and Settings\All Users\Application Data\NVIDIA Corportation\NVIDIA CUDA SDK\
which initially caused me some problems. Are all of your paths resolving correctly?
This might sound like a far out suggestion. Get the CUDA SDK and try your code with the sample CUDA-C++ project in there. Maybe something changed in the build rules for CUDA v2.1.
If you go to Tools->Options->Projects and Solutions->Build and Run. Last property is "MSBuild Project build output verbosity". It defaults to Minimal, change it to normal and the build messages will show up in Output window.
This also enables any <Message Text="test message"></Message> output to show up in Visual Studio Build Output Window.
Final solution: reinstall the OS.