c++ Random unexplained error - c++

I'm creating a kinect project in Visual Studio 2008 using OpenNi, NITE and OpenGL.
At random times dureing development I get the following error:
Error result 1 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\rc.exe'.
I've searched the internet with no luck.
I am able to create a new project and copy all my code across and it works fine but this is not something I want to be doing multiple times each day.
If any more info is required I'd be happy to give it.
EDIT full output window reads
1>------ Build started: Project: PointViewer, Configuration: Debug Win32 ------
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>fatal error RC1110: could not open ..\Res\NITE.rc
1>Project : error PRJ0002 : Error result 1 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\rc.exe'.
1>Build log was saved at "file://d:\Documents\Uni work\Year 4\Personal Project\Samples \PointViewer\Debug\BuildLog.htm"
1>PointViewer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

You are referencing your RC file via a relative path (..).
It seems likely your current directory is changing, and hence .., and the path to your RC file changes, causing the error.
You will have to make sure that your RC file is referred to in a way that doesn't change.
Try removing it from the project, and re-adding it, taking care to refer to it only in absolute terms.
Check your project and build settings for the directory where the build is to start, and how the filename is preserved in the project settings. You're looking for something like "Persist Filenames As...".

I had the same error. Move your entire project folder into documents/visualstudio/projects. If that doesn't work, move it to your desktop. It is just a linking problem, it can't find the resources. Make sure you aren't moving your folders around as this can cause these issues.

A possible reason for the error described - .rc file was renamed.
Check the .rc file name in your .vcproj file and see that it actually exists on disk.

Related

Building vcxproj file gives me a informationless error "The system cannot find the path specified"

When I build a project in vs 2017, I can get errors like this:
1>------ Build started: Project: TortoiseGitMerge, Configuration: Debug Win32 ------
1>Performing Custom Build Tools
1>The system cannot find the path specified.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 3.
1>Done building project "TortoiseMerge.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 10 up-to-date, 0 skipped ==========
In this error message, there is no information leading me closer to a solution.
Which path was specified?
How do I find out? What is the exact reason that the path in question was not written in that error message?
Performing Custom Build Tools
That isn't enough to know what is going on. You'll want to jack up the build verbosity so you can see these custom build commands getting executed. Finding the one that failed then gives you a shot at diagnosing the mishap.
Use Tools > Options > Projects and Solutions > Build and Run, "MSBuild project build output verbosity" = Detailed. The build trace you now see in the Output window gets a lot more chatty and should show the actual command that fell over.

Permission error every time I build in visual studio 2015

I have just started learning to program using Unreal and I am following a tutorial for Unreal Engine on Udemy and recently I've been running into a problem where every time I write code wrong and I build the project , even though there are no lines indicating errors , I get this message
>
1>------ Build started: Project: BuildingEscape, Configuration: Development_Editor x64 ------
1> Compiling game modules for hot reload
1> Performing 2 actions (2 in parallel)
1> [2/2] Link UE4Editor-BuildingEscape-2523.lib
1> [1/2] Link UE4Editor-BuildingEscape-7173.dll
1> Creating library D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-7173.lib and object D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-7173.exp
1> Creating library D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-7173.suppressed.lib and object D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-7173.suppressed.exp
1>ERROR : UBT error : Failed to produce item: D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-BuildingEscape-2523.lib
1> Total build time: 3.07 seconds (Local executor: 0.00 seconds)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ""D:\Unreal Engine\Engine\UE_4.15\Engine\Build\BatchFiles\Build.bat" BuildingEscapeEditor Win64 Development "D:\Unreal Projects\03_BuildingEscape\BuildingEscape\BuildingEscape.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
and even though I delete the code that I wrote and hit build again I get the same error...
I am using windows 10.
Before you go too far down the rabbit hole, check to be sure your operating system doesn't simply have a lock on one of your intermediate files. If you delete the entire contents of D:\Unreal Projects\03_BuildingEscape\BuildingEscape\Intermediate\ before rebuilding, that will ensure that you're not simply looking at a locked or corrupt intermediate. This isn't guaranteed to be the issue, but bad intermediates can cause otherwise inexplicable build errors, so clearing them can at least narrow down the range of possible causes you'll need to investigate. Of course make sure your editor isn't running, or running as a stuck process, while you're trying to rebuild.
I don't know what is causing the issue with compiling from visual studio , but if I compile using the Compile button in Unreal the code seems to be compiling just fine.

Running QWT example program(.pro) with Visual Studio 2010 error

I face the following error when trying to run a qwt example, the oscilloscope example to be exact in Visual Studio QT add in. There will be build errors, and the following lines will be shown:
1>------ Build started: Project: oscilloscope, Configuration: Debug Win32 ------
1>Build started 3/1/2014 4:57:18 PM.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(298,5): warning MSB8004: Intermediate Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Intermediate Directory.
1>InitializeBuildStatus:
1> Touching "Win32\Debug\oscilloscope.unsuccessfulbuild".
1>CustomBuild:
1> Moc'ing knob.h...
1> The syntax of the command is incorrect.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 255.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.05
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Do anybody have any idea why? Not sure if this problem is related, but when I open qt project from Visual Studio, the output from the "Qt Visual Studio Add in" shows:
--- (Import): Generating new project of oscilloscope.pro file
--- (qmake) : Using: c:\qt\qt5.1.1\5.1.1\msvc2010\bin\qmake
--- (qmake) : Working Directory: C:\qwt-6.1.0\examples\oscilloscope
--- (qmake) : Arguments: -tp vc "oscilloscope.pro" -o "oscilloscope.vcxproj" QMAKE_INCDIR_QT=$(QTDIR)\include QMAKE_LIBDIR=$(QTDIR)\lib QMAKE_MOC=$(QTDIR)\bin\moc.exe QMAKE_QMAKE=$(QTDIR)\bin\qmake.exe
--- (qmake) : Exit Code: 0
Could not parse QTDIR from project file oscilloscope.vcxproj.
--- (Import): Added oscilloscope.vcxproj to Solution
=== Update uic steps ===
=== 0 uic steps updated. ===
=== Update rcc steps ===
=== 0 rcc steps updated. ===
Could the "could not parse QTDIR from project file oscilloscope.vcxproj" be the cause of this problem?
All the examples are able to run in qt creator itself. This problem only occurs when I try to run in from Visual Studio.
I have already ran through the proper installation guide found on the qwt website for both qt creator and MSVC. Any idea why this problem occurs? Please help. Any advice or suggestion will be greatly appreciated.
There was a bug in the Visual Studio add-in when using subdirs. Try to change this in the qwt.pro file before importing:
SUBDIRS = \
src \
textengines
to:
SUBDIRS = src textengines
Then, do the import again. You could also use a fixed version of the Visual Studio add-in.
Here you can find the corresponding issue on the Qt bug tracker:
Qt Visual Studio Add-in 1.1.0 doesn't parse QTDIR correctly in a project with SUBDIRs
I solved this error by deleting this line into the qwtbuild.pri file:
CONFIG += silent
Now all the examples of qwt library are working well!
Try to delete the %40echo moc .* && in qwt.vcxproj qwt_designer_plugin.vcxproj.
After that, you should reload the projects.
I am using VS2013 Qwt6.1.2 Qt5.6.0.
I have the exact same problem using Visual Studio 2012, VS addin1.2.2, Qt 5.2, Qwt 6.1, when trying to compile the bode example. None of the above hints seem to help, in particular I don't see any multiline SUBDIRS in the .pro file.

Cannot open DefaultTest.dll for unit test

When I try to run my unit test in VS 2012 I get the following error:
1>------ Build started: Project: Tests, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'C:\Users\Patryk\Documents\Visual Studio 2012\Projects\LUT\Debug\DefaultTest.dll'
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
It works again, when I restart VS but then I get the same error after I have to rebuild the project
"DefaultTest.dll" is a remnant of not changing the Target Name in the project's General Configuration Properties.
The same thing happens to me in Visual Studio 2010. Removing the .dll and .dll.metagen files from the output directory and rebuilding the test project solved the problem in my case.
I get this error if the testing engine is still running in background.
Check if the vstest.executionengine.x86.exe process is still running in background, and kill it if so. Afterwards you can rebuild and run your tests.

Problem while building a .dll (Visual C++)

I am trying to build a .dll in order to link it to one of my projects. But the build always fails : I got these messages in the output and I don't know what it means. It seems that something is missing, but I couldn't find what.
I am trying to link a Mesher called Netgen
http://www.hpfem.jku.at/netgen/
1>adfront2.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
1> Creating library D:\Documents\Visual Studio 2008\Projects\converter/lib\nglib.lib and object D:\Documents\Visual Studio 2008\Projects\converter/lib\nglib.exp
1>Embedding manifest...
1>Performing Post-Build Event...
1>Environment variable NETGENDIR not found.... using default location!!!
1>POSTBUILD Script for nglib ........
1>Installing required files into XXX\Netgen\windows....\nglib-instNoOCC_Win32 ....
1>File not found - nglib.dll
1>0 File(s) copied
1>POSTBUILD Script for nglib FAILED..... Error copying the nglib DLL into install folder!!!
1>Project : error PRJ0002 : Error result 1 returned from 'C:\Windows\SysWow64\cmd.exe'.
1>Build log was saved at "file://D:\Documents\Visual Studio 2008\Projects\converter\BuildLog_nglib.htm"
1>nglib - 1 error(s), 49 warning(s)
I hope I am clear enough and thank you by advance for your help.
seems this NetGen lib's project wants to run a post-build event in which it tries to copy the main output (the nglib.dll) to the directory NETGENDIR (which is supposed to be an environment variable). This fails beccuse the dll isn't found.
Either disable the post build event, or check with the NetGen lib's creator what they expect here, there seems to be a mismatch between the project's output dir and the postbuild event.
Would also be nice to see the postbuild event from the vcproj file, maybe you can post it?
You need read, by example the output line:
1>Environment variable NETGENDIR not found.... using default location!!!
After that I suggest that you must read the documentation about how define a enviroment variable named: NETGENDIR