fatal error LNK1201: error writing to program database - Visual Studio 2003
Asked Answered
J

6

8

I get this error: fatal error LNK1201: error writing to program database every time I edit my code and build again in visual studio 2003.

The issue is resolved if I restart VS2003 but I need to do this every time i build the project.

I have been googling and stackoverflowing ;) for a few hours and have tried the following proposed solution:

  1. Change the Debug Information Format from Zi to Z7. (Property -> C/C++ -> General -> Debug Information Format)

    This did not work

  2. Change Visual Studio Compatibility Mode to Windows XP SP3

    This did not work

  3. Add the following in the Pre-Build Event : net stop "Machine Debug Manager" net start "Machine Debug Manager"

    This produced the following error: System Error 5 has occurred. Access is denied. This could be because I do not have Admin Access on this machine.

  4. I have not tried this one because I am not allowed to download untrusted code at my work. Run FreePDB.cmd posted by Tony76 here

  5. Changed the Symbol Path as seen here: image

    This did not work

What I know:

This error could occur if the pdb file exceeds 1GB but mine is only 10MB.

My limitations:

  1. I do not have Admin Access on this computer
  2. Cannot run untrusted software (Work Computer)
Jeannettejeannie answered 26/2, 2016 at 22:24 Comment(5)
This happens to me (somewhat frequently) when my projects/solutions are on a network share and/or I don't have write access ... have you tried changing your symbol path ..?Jotting
I have not. I will try this right awayJeannettejeannie
Did not work, thanks for tryingJeannettejeannie
Aggressive anti-malware is by far the most common cause of this problem. If you can't do anything about it then you're kinda screwed. Pass this off to whomever is responsible for keeping the machines inside the company running.Breastplate
That's what I was afraid of. Thanks for your input.Jeannettejeannie
S
5

I came across the same problem when I was moving my VS project from old disk to new PC. Deleting all debug files eliminated the issue, maybe Clean-Build would solve it as well, but that is not what I have tried.

Squib answered 19/4, 2020 at 10:18 Comment(2)
Deleting the .pdb file mentioned in the error worked for me.Columbarium
Clean + Build works too.Deva
S
2

I had this issue in VS2017. Deleting the PDB mentionned in the error solved it for me.

Spinney answered 19/8, 2021 at 8:33 Comment(0)
M
1

I use a program called LockHunter to unlock the PDB file. This works, though from time-to-time if stops successfully unlocking (or recognizing that the PDB file is locked) and I have to restart my PC

Marlite answered 19/3, 2019 at 6:51 Comment(0)
S
0

Had similar problem on Windows 10. This answer provides a solution using a tool called FreePDB. Worked for VS2003.NET, but apparently this solution works for multiple versions of Visual Studio.

Screens answered 12/2, 2019 at 12:30 Comment(0)
V
0

Had similar issues when the solution was open in both VS2017 and VS2013. Fixed this issue by closing both the visual studio instances and re-opened the solution file.

Viridis answered 25/2, 2020 at 4:32 Comment(0)
M
0

Quick fix for some cases, close all msbuilds and running instances, some prior run may crashed and holding the some files/pdb

Misapprehension answered 26/10, 2020 at 9:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.