Solved

How to avoid LNK1201 Error Writing to Program Database?

Posted on 2003-11-04
4
2,735 Views
Last Modified: 2013-12-03
I have a very large application built in MSDEV 6.0.
I seemed to have approached a size limit for the .pdb file.
(It is around 64M.)
I get the LNK1201 error every other time I build the app.
I have several Gig of available disk space, so that's not the issue.
Removing the existing .pdb seems to allow it to build.
Rebuilding the .pdb from scratch each time seems to fix it,
but it unfortunately takes a long time to link the app.
I started removing debug symbols from the app using the
/Zd compiler flag.

Can anybody confirm that this size limit exists in VC60?
Is it the same in 7.0?
Do you know of any better workarounds for this problem?

Also, strangely enough, a fellow developer here builds the same
exact app on a different machine, but has a much smaller .pdb file.
He has the same version of compiler & linker that I do.
What can explain this difference?

Thanks.
0
Comment
Question by:bwilhelm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 9679652
>>I seemed to have approached a size limit for the .pdb file.

Indeed - see http://support.microsoft.com/default.aspx?scid=kb;en-us;238875 ("PRB: C2471 or LNK1140 Error with PDB File Limits")

SYMPTOMS
The following errors are normally related to running into the module and size limits when a program database (PDB) file is created (a PDB file contains information used by the debugger; the file has a .pdb extension):

Compiler Error:

C2471: cannot update program database
Linker Error:

LNK1140 "too many modules for program database; relink with /PDB:NONE"

Linker Error:

LNK1201: error writing to program database "c:\MSDEV\Projects\yourapp\Debug\yourapp.pdb"; check for insufficient disk space


>>Is it the same in 7.0?

The article states:

The information in this article applies to:
Microsoft Visual C++, 32-bit Enterprise Edition 5.0
Microsoft Visual C++, 32-bit Enterprise Edition 6.0
Microsoft Visual C++, 32-bit Professional Edition 5.0
Microsoft Visual C++, 32-bit Professional Edition 6.0
Microsoft Visual C++, 32-bit Learning Edition 6.0


CAUSE
There is a limit of 4096 modules (.obj files) in a PDB file. The file also has a total size limit of approximately 64 MB.

RESOLUTION
There are several ways to reduce the size of PDB files:
Build some of the source files with the /Zd switch (line numbers only).
Build some of the source files as separate dynamic-link libraries (DLLs) instead of static libraries.
Build some of the source files without debug information.
Try the compiler switch /Fd"myproject.pdb" (including the quotation marks).
0
 
LVL 86

Expert Comment

by:jkr
ID: 10801416
I'd say the Q is answered...
0
 

Expert Comment

by:haggersr
ID: 25955339
This doesn't resolve the issue. It still exists in 2009. vs7.1 and 8.0 still has this issue. MS needs to fix their IDE software (C++).
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to adjust sheet 1 96
Messagebox for a Web Site Application 4 86
Build VS2015 project in bat command 3 105
What .NET URL re-routing tool did I use? 2 90
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question