Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to avoid LNK1201 Error Writing to Program Database?

Posted on 2003-11-04
4
Medium Priority
?
2,841 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
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 1500 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

927 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