Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get the error C1033: cannot open program database in VS 2010

After a long break from C++, I am trying to compile a very simple C++ project in VS2010. I created a Win32 C++ console empty project, I selected No precompiled headers and no other MS libraries. I added the following main.cpp file:

#include <iostream>
#include <string>

using namespace std;

class A
{
public:
  string name;
};

int main(int argc, char** argv)
{
  return 0;
}

When I compile I get the infamous error:

1>------ Build started: Project: TestGetline, Configuration: Debug Win32 ------
1>  main.cpp
1>main.cpp : fatal error C1033: cannot open program database ''
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Here are a some facts:

  • I am running Windows 7 64 bit as VM with Desktop Parallels: Version 6.1.7601 Service Pack 1 Build 7601. The VM has the Shared Profile checked, which means that the Documents, Downloads etc. folders are shared between OSX & Windows 7.

  • VS 2010 version: Microsoft Visual Studio 2010, Version 10.0.40219.1 SP1Rel, Microsoft .NET Framework Version 4.0.30319 SP1Rel

  • The link that I am using to launch VS 2010 has the Run this program in compatibility mode for Windows XP (Service Pack 3) checked. The Run this program as an administrator is not checked.

  • I tried a few things suggested in other posts and none of them worked. I tried, for instance, to kill the mspdbsrv.exe (VS 2010 was closed), remove the debug directories by hand, and then recompile the project. I tried to change the Debug Information Format to C7 compatible but then I get another error (main.cpp : fatal error C1074: 'IDB' is illegal extension for PDB file:). I tried to run VS 2010 as administrator but the error is as stubborn as a bedbug. And yes, there was antivirus running while trying all this.

Any other ideas? One cannot help to wonder if there is anyone at all doing C++ development in VS 2010. Upgrading to VS 2012 or 2013 is not an option at this time.

Thanks

Just an update, here is the output of the build task that fails from the compilation log file:

 1>Target "ClCompile" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets" from project "C:\projects\cpp\TestGetLine\TestGetline\TestGetline.vcxproj" (target "_ClCompile" depends on it):
   Using "Delete" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
   Task "Delete"
   Done executing task "Delete".
   Task "CL" skipped, due to false condition; ('%(ClCompile.PrecompiledHeader)' == 'Create' and '%(ClCompile.ExcludedFromBuild)'!='true') was evaluated as ('' == 'Create' and ''!='true').
   Using "CL" task from assembly "Microsoft.Build.CppTasks.Win32, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
   Task "CL"
     Forcing recompile of all source files due to missing PDB "Debug\vc100.pdb".
     Environment Variables passed to tool:
       VS_UNICODE_OUTPUT=1328
     c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
     Tracking command:
     C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\Tracker.exe /d C:\Windows\Microsoft.NET\Framework\v4.0.30319\FileTracker.dll /i C:\projects\cpp\TestGetLine\TestGetline\Debug /r C:\PROJECTS\CPP\TESTGETLINE\TESTGETLINE\MAIN.CPP /b MSBuildConsole_CancelEvent7f4b09d9e64d472facf5c417755b2cdd  /c "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe"  /c /Zi /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
     main.cpp
 1>main.cpp : fatal error C1033: cannot open program database ''
     The command exited with code 2.
   Done executing task "CL" -- FAILED.
 1>Done building target "ClCompile" in project "TestGetline.vcxproj" -- FAILED.
 1>Done Building Project "C:\projects\cpp\TestGetLine\TestGetline\TestGetline.vcxproj" (build target(s)) -- FAILED.
like image 773
costa Avatar asked Dec 02 '13 23:12

costa


2 Answers

To solve this problem, I deleted the pdb file (after I backed it up), then builded it.

like image 118
Leonardo Miquelutti Avatar answered Oct 18 '22 21:10

Leonardo Miquelutti


I get this error all the time when I am running a project in my dropbox folder. It seems that dropbox is backing up the .pdb file at the time I'm trying to build.

Usually it works after one or two tries.

like image 39
tashage Avatar answered Oct 18 '22 21:10

tashage