visual c++ 2010 C++ build problems - c++

When compiling any C++ project with visual studio 2010 express I'm liable to get following behaviour - build started message appears in output window, CPU climbs to near 100%, multiple MSBuild.exe processes are spawned, long pause (several minutes) with nothing happening, build aborts with the following message
xxx.vcxproj : error MSB4014: The build stopped unexpectedly because of an internal failure.
xxx.vcxproj : error MSB4014: Microsoft.Build.Exceptions.BuildAbortedException: Build was canceled. MSBuild.exe could not be launched as a child node as it could not be found at the location "c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe". If necessary, specify the correct location in the BuildParameters, or with the MSBUILD_EXE_PATH environment variable.
xxx.vcxproj : error MSB4014: at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)
xxx.vcxproj : error MSB4014: at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)
xxx.vcxproj : error MSB4014: at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
xxx.vcxproj : error MSB4014: at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
xxx.vcxproj : error MSB4014: at Microsoft.Build.Execution.BuildManager.IssueRequestToScheduler(BuildSubmission submission, Boolean allowMainThreadBuild, BuildRequestBlocker blocker)
Microsoft have acknowledged a bug with this behaviour when your user name is 20 chars, but mine is much shorter. And needless to say I do have msbuild.exe in the right place.
The only work around I've found is to task switch to another app while the build is taking place. But I'm hoping someone has a better workaround.
MTIA
John

You've already eliminated KB2298853. Do make sure to install SP1. It is not the only reason, some other users have this problem too, even after the workaround. The basic failure appears to be a problem creating a pipe that lets msbuild talk to the IDE. Which is why it doesn't fail when you run msbuild from the command line.
This is an environmental problem, as yet undiagnosed. You need to chase down the reason the execution environment is unusual on your machine. Do so by selectively disabling or killing processes. Start with your malware software. Also, start another instance of Visual Studio and use Tools + Attach to Process to attach an unmanaged debugger to the first instance and/or msbuild. Debug + Break All and use Debug + Windows + Modules to find out what DLL might be injected in the process that is not made by Microsoft. Pay attention to the Path column. Not sure if Attach to Process is available on the Express edition btw.

it's actually just the behavior shield in avast that is causing the problems with visual studio.
if you turn that off when trying to build, it will build and run. now we just need either microsoft or avast to create an update which will eliminate this problem. just discovered this 10 mins ago. at 2:50 pm 12/3/2011 central standard time in wisconsin

I can confirm that this problem was also solved for me by turning off Avast's behavior shield. Something is definitely not right with that. Endless MSBuild.exe (and conime.exe) processes and devenv.exe maxing out the CPU. Seems to be a real system killer there by Avast. :-(

In my case simply restarting VS2010 helped fix the error. Anyone encountering this error might want to try that first.
(I am using VS 2010 with SP1)

Related

QtMsBuild -> Qt::BuildLock

We have a fairly large solution (>200 projects) and recently switched to VS2019. We are using Qt 5.14 with Qt Visual Studio Tools 2.7.1.18 and QtMsBuild. After we started using VS 2019 we get the following warning multiple times when we build the solution:
"...\AppData\Local\QtMsBuild\qt_globals.targets(131,5): warning : Qt::BuildLock[{E42AFBC7-0C5E-441F-B1DB-AE4C9E75F86E}]: Waiting..."
The GUID is the GUID from one of the projects in the solution. Sometimes the build process even hangs up on the "Waiting..." but in most cases the warning does not seem to have an obvious effect other than that it is displayed.
My question is: Where does this warning come from? Why does it show? And how can we get rid of it?
I recently had a problem pop up seemingly out of nowhere. It's described in this issue: Visual C++ Builds Failing due to Log File Access Collision
Based on my investigation, Visual Studio appears to be redundantly building project dependencies instead of just referencing them, and when multiple projects with the same dependency build simultaneously, they will both hit a log file (or some other file) simultaneously, causing one to fail due to access restriction.
It seems that the QtMsBuild developers solved this by adding a CriticalSection task to the QtPrepare target preventing concurrent access. The downside is that this gets reported as a warning.

How do I fix "Error C1033: cannot open program database"? [duplicate]

During a long compilation with Visual Studio 2005 (version 8.0.50727.762), I sometimes get the following error in several files in some project:
fatal error C1033: cannot open program database 'v:\temp\apprtctest\win32\release\vc80.pdb'
(The file mentioned is either vc80.pdb or vc80.idb in the project's temp dir.)
The next build of the same project succeeds. There is no other Visual Studio open that might access the same files.
This is a serious problem because it makes nightly compilation impossible.
It is possible that an antivirus or a similar program is touching the pdb file on write - an antivirus is the most likely suspect in this scenario. I'm afraid that I can only give you some general pointers, based on my past experience in setting nightly builds in our shop. Some of these may sound trivial, but I'm including them for the sake of completion.
First and foremost: make sure you start up with a clean slate. That is, force-delete the output directory of the build before you start your nightly.
If you have an antivirus, antispyware or other such programs on your nightly machine, consider removing them. If that's not an option, add your obj folder to the exclusion list of the program.
(optional) Consider using tools such as VCBuild or MSBuild as part of your nightly. I think it's better to use MSBuild if you're on a multicore machine. We use IncrediBuild for nightlies and MSBuild for releases, and never encountered the problem you describe.
If nothing else works, you can schedule a watchdog script a few hours after the build starts and check its status; if the build fails, the watchdog should restart it. This is an ugly hack, but it's better than nothing.
We've seen this a lot at my site too. This explanation, from Peter Kaufmann, seems to be the most plausible based on our setup:
When building a solution in Visual Studio 2005, you get errors like fatal error C1033: cannot open program database 'xxx\debug\vc80.pdb'. However, when running the build for a second time, it usually succeeds.
Reason: It's possible that two projects in the solution are writing their outputs to the same directory (e.g. 'xxx\debug'). If the maximum number of parallel project builds setting in Tools - Options, Projects and Solutions - Bild and Run is set to a value greater than 1, this means that two compiler threads could be trying to access the same files simultaneously, resulting in a file sharing conflict.
Solution: Check your project's settings and make sure no two projects are using the same directory for output, target or any kind of intermediate files. Or set the maximum number of parallel project builds setting to 1 for a quick workaround. I experienced this very problem while using the VS project files that came with the CLAPACK library.
UPDATE: There is a chance that Tortoise SVN accesses 'vc80.pdb', even if the file is not under versioning control, which could also result in the error described above (thanks to Liana for reporting this). However, I cannot confirm this, as I couldn't reproduce the problem after making sure different output directories are used for all projects.
Switch the debug info to C7 format instead of using the PDB.
Project Options -> C/C++ -> General -> Debug Information Format and set it to C7.
This generally happens when your previous attempts at debugging have not killed the debugger fully.
In Task manager look for a process called vcjit, kill it and try again.
Worst option restart visual studio, this should solve your problem.
I had this problem today and it turned out to be non-ansi characters in the path to the pdb that caused it.
I'm using windows through vmware, and my project was in a shared location: \vmware-host\Shared Folders\project
When I moved it to \Users\julian\project it resolved the issue.
I just ran into this problem. Visual studio was complaining about not being able to open vc100.pdb. I looked for open file handles to this file using procexp and found out that the process mspdbsrv had an open file handle to it. Killing this process fixed the issue and I was able to compile.
Try right click the excutable file of VS....and Properties->Compatibility-> Tick "Run this program in compatibilty mode for:" OFF........
I had a similar problem while working on a project which I had located in my Dropbox folder. I found that it would throw this error when the little "syncing" icon was going on the Dropbox icon in the system tray, since Dropbox was accessing the files to upload them to their server. When I waited to build until Dropbox finished syncing, it worked every time.
I have same problem C1033: cannot open program database,
Scenario
I have two dll's parent.dll and child.dll.I just attached child.dll project with visual studio debugger at the same time i am trying to build the parent.dll project,produces error C1033: cannot open program database
Solution
Stop debugging and kill the process attached with the debugger.Rebuild the project
This happens to me consistently if I Ctrl+Break to cancel a build (vs2015). There's some process that isn't shut down properly. I went on a rampage "End Tasking" ms/vs related processes (look for duplicates) and my build worked again. A restart would probably work too. As would moving to gnu binutils.
Annoyingly unlocker tools don't report any processes locking the file, windows doesn't let me delete the .pdb but I can rename it. My guess is two processes jump in at the same time during a build.
Are you using LinqToSql at all? Perhaps it is similar to the odd error I will experience occasionally as I asked in this question: What causes Visual Studio to fail to load an assembly incorrectly?
I changed my intermediate directory from:
%TEMP%\$(ProjectName)\$(Platform)\$(Configuration)\
to
C:\temp\$(ProjectName)\$(Platform)\$(Configuration)\
It works now. NO idea why.
In my case the problem was Google Drive: I forgot that the project was under a synced folder and G Drive probably locked that file. Pausing the sync didn't help since the error was throwed anyway.
Moving the project folder to another location not synced by Google Drive solved my issue.
Just to mention, at the beginning I thought it was my anti-virus, since when examinating the file using procexp it showed that the file was used by one of my anti-virus process. Excluding the folder project from my anti-virus scan didn't help in my case.
the simplest solution is "build one more time":
BuildConsole abc.sln /rebuild /cfg="release|Win32"
if %errorlevel% neq 0 (
BuildConsole abc.sln /cfg="release|Win32"
if %errorlevel% neq 0 (
rem process error
exit 1
)
)
I just ran into this problem and Google led me here. For me, it was Google Drive syncing my project files while I'm trying to run. Pausing Google Drive sync temporarily solved it, but I'd rather there was a way for Google Drive to keep its hands off while Visual Studio is doing its stuff. If anyone knows how I can configure that, please let me know

Can't run VS 2015 Community without /resetsettings; Getting CANTLOADLIBRARY on opening new projects, and crashing on new .cpp files

I have Windows 10, fully updated.
I downloaded and installed Visual Studio Community 2015 last week for the first time, (previously programmed in Code:blocks, still installed) and selected custom install to allow for C++ and Python programming.
Installation ran smoothly, but VS always fails on launch.
On first launch ever, it said it was setting things up for first startup; asked me for sign-in which I did, at which point it briefly showed something about my profile before saying 'An error occurred while starting for the first time. Please restart Microsoft Visual Studio'. Imgur images of all dialog boxes here, including parts of a processmonitor log I estimated to be around the general time of the error.
Closing and restarting several times didn't help.
Uninstalling and re-installing didn't help.
Rebooting didn't help.
And uninstalling, running Ccleaner's Cleaner and Registry Cleaner, rebooting computer and re-installing VS didn't help either.
Repairing the install from Programs also didn't help.
I managed to find the exact same error on Google Search for VS 2013 but the only solution was where one person got a completely new OS and re-installed VS on that.
I tried the other suggestions they had including running:
devenv.exe /safemode
devenv.exe /resetskippkgs
devenv.exe /resetuserdata
devenv.exe /installvstemplates
devenv.exe /resetsettings
the first 3 took me to the same sign-in screen. Regardless of signing-in or not, or running VS from the Administrator Profile or not, these option always give the same failed on first startup error.
Installvstemplates gives an error saying the operation could not be completed, but /resetsettings finally got me into VS.
That's about all it does though, I can go to the home page and access options/menu buttons, but signing-in makes it crash and reload again (but it does sign me in and take me to the home screen)
Signed-in/not and Administrator or not, VS crashes on opening a new .cpp file.
When I click Start a New Project I get "Error loading type library/DLL.(Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)). Closing VS and trying to open it normally from start menu still always throws the original error, despite working if I open it via /resetsettings.
I've also checked [HKEY_CLASSES_ROOT\CLSID{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32] in Regedit and found it is apparently correct.
I also used devenv /log to generate an xml file of the process when I open it.
Just to mention I have .NET Framework 4.5-4.6 installed with VS as well.
Looking forward to any advice.
So, for anyone else getting the same problem, I haven't gotten any other advice, since this post.
If you're still having probs # this point the only real solution seems to be a clean install of your OS .
I can confirm it solved all my issues, with VS + some OS problems I wasn't aware of . I can only assume they might've been related, good luck.

Unable to start UE4Editor.exe

Trying to launch the editor from Visual Studio 2013 Ultimate I get the following error in the title. VS says it's because it can't reach MSVSMON.EXE on a "remote computer", the weird thing is that I'm not trying to debug on a remote computer, but rather, on my own. My firewall is ZoneAlarm if that makes any difference.
Any help?
Edit: I've set all in and outbound communication to and from both unreal and visual studio in my firewall to "allowed", yet for some reason it still won't let me debug...
Edit 2: Disabling the firewall entirely does nothing at all.. The error persists
Edit 3: Uninstalling ZA altogether seems to fix the issue
Just a note, so far you've been chasing the wrong problem and have not yet gathered enough relevant facts. The dialog is very unhelpful, this does not have anything to do with a "remote computer".
Msvsmon.exe is used in this scenario because UE4Editor.exe is a 64-bit process. Visual Studio cannot use its built-in debugger, it is a 32-bit process. Debugging a 64-bit process with a 32-bit debugger is not possible. So it has a workaround, it uses the 64-bit remote debugger, C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe. Basically works the same has remote debugging on another machine, except it doesn't use the network to connect to the debugger.
So your firewall settings and the considerable amount of trouble-shooting info about remote debugging you can find on the web or MSDN just does not apply in your case at all. You've been chasing the wrong problem.
Having an issue with msvsmon.exe when debugging 64-bit code is quite unusual, never heard of anybody having trouble with it before. You want to do a basic smoke test to check if it is really a problem with msvsmon.exe or it is actually UE4Editor.exe that puts up a fight.
Create a little do-nothing C# console mode app, just Console.ReadLine() in the Main() method. Project + Properties, Build tab, untick the "Prefer 32-bit" option. This ensures it runs as a 64-bit process. Press F5. If all is well then it starts running and you'll see msvsmon.exe in the Task Manager, Processes tab.
If that does not work either then something is interfering with the process interop between Visual Studio and msvsmon.exe. Usually anti-malware related, disable that first. Next thing to try is to start killing processes one-by-one with Task Manager to find the evil-doer. If debugging the C# app works okay then you have a good reason to visit the UE4 forum to find help.
Update your question with what you've learned.
Uninstall Zone Alarm and everything will be OK.

Jenkins build fails when user logs off node

Sometimes, builds done by Jenkins (1.461) will stop at a random spot somewhere in the middle. These builds are manually scripted calls to Visual Studio 2008 SP1's devenv.com for primarily C++ code. Visual Studio emits no error messages; the last message in devenv's log is some random file being built. The Jenkins build fails because of a post-build Windows batch command that relies on some of the build outputs. This happens fairly rarely (roughly 1 in 15 builds). Jenkins's error log shows nothing out of the ordinary around the time the build fails. Surprisingly, it says the build succeeded, even though it shows it as failed everywhere else.
The problem is isolated to Jenkins. The same build script run at a developer's desk has never failed in this way.
The Jenkins nodes are 32-bit Windows XP machines. They all have ample available disk space. Jenkins is configured to only run one job at a time per node. The event logs show no obviously bad things (e.g., Visual Studio crashes) happening at the times when the builds stop.
Does anyone have any ideas of things to look into to troubleshoot this?
I don't recall ever having this problem with jenkins myself, but I have regular linker crashes in MSVC 2008. This happens almost everyday for me. If it is the linker crashing then that could be an explanation.(perhaps a linker crash is not logged?)
Edit:
We use MSVC2008 SP1 on 32-bit Win7.
We use MSBuild 3.5 when building the c++ solutions.
We ended up correlating the random build failures with logoff events on the Jenkins nodes. This lead to this JVM bug/feature (Oracle Java bug ID 6871190), where a logoff event in Windows causes the signal handlers to terminate the JVM. You can disable this behavior (perhaps with other downsides) by passing the -Xrs option to the JVM, but that option will not automatically propagate to child Java processes.
We are passing -Xrs to kick off Jenkins itself, and the Jenkins service itself lives through a logoff. The current hypothesis is that some part of Jenkins's build process is kicked off through another Java child process who is not invoked with -Xrs.