1

I accidentally allowed an infinite loop, the computer froze, I force-restarted it. Now when I press F5 to build my C++ project, I get the following error:

Error   C1301   error accessing program database C:\path\x64\Release\projectName.ipdb, invalid format, please delete and rebuild

And the said file does not even exist. I tried deleting everything in the Release folder, no luck.

How can I solve this?

Thanks in advance.

jeff
  • 13,055
  • 29
  • 78
  • 136
  • Try renaming the Release folder. And if that doesn't work - machine restart usually helps :) – Rostislav Oct 07 '15 at 19:58
  • @Rostislav thanks. I renamed Release folder, it created another Release, again not containing the *.ipdb file. Should it contain it? Anyway, let me try another restart. – jeff Oct 07 '15 at 19:59
  • That is surprising to be honest. Usually it's some screw-up with file access rights. And sometimes the renaming lets you avoid these problems without restart. However, I've never seen such troubles persisting through a restart. Perhaps restart and 'rebuild project' would help. If not - well, I'd delete the build directory and regenerate the project with CMake - but if it's not a CMake project - I have no further ideas :/ Good luck! – Rostislav Oct 07 '15 at 20:02
  • I don't know how to use CMake :) So I don't think it is. It is just a Win32 console application with c++. And the problem remains after restart and rebuild.. – jeff Oct 07 '15 at 20:06
  • Well, I hope someone else will be able to help you :) And CMake is a very nice tool - so it's worth learning about it in the long run. – Rostislav Oct 07 '15 at 20:08
  • `Visual Studio 6.0 error accessing program database filename, invalid format, please delete and rebuild This error is not used.` Whoa, which visual studio are you using? – Rostislav Oct 07 '15 at 20:16
  • Also, see here about some notes regarding antivirus stuff: http://stackoverflow.com/questions/126751/compilation-fails-randomly-cannot-open-program-database – Rostislav Oct 07 '15 at 20:18
  • It is Visual Studio 2015 Community edition. – jeff Oct 07 '15 at 20:34
  • This is severely weird... I'd try repairing the installation if the VS installer supports it. Something went terribly wrong it seems. Does any other project compile fine? – Rostislav Oct 07 '15 at 20:38
  • I'm not sure but I worked around the problem simply by creating a new project, and copy pasting the contents of my .cpp and .h files. Luckily I had few of them. – jeff Oct 07 '15 at 21:37
  • Wait, how did you see the `Visual Studio 6.0` part? :D – jeff Oct 07 '15 at 21:58
  • 1
    just googling the error message :) And what you did is pretty similar to regenerating project with CMake. Good that you figured it out in the end! – Rostislav Oct 08 '15 at 01:08
  • 1
    for me it helped to clean the project (in all configurations and targets!) – BNT Jul 28 '17 at 10:50

1 Answers1

2

I was also faced similar type of error which says :-

"C1300 Error accessing program database... LNK1257 code generation failed"

Resolved it in the following way:

Project->Properties->Configuration Properties->General->Whole Program Optimization

set it to

"No Whole Program Optimization"

from "Use Link time Code Generation"