Fixing “fatal error C1033: cannot open program database … vc60.pdb” with make and Visual Studio

By neokrates, written on February 24, 2011

howto

  • Join date: 11-30-99
  • Posts: 224
View Counter:
  • 966 views
Rate it
Ad
Poll
  • What tools do you use for site design?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext

Both vc60.pch and vc60.pdb may become locked by Visual Studio, so that Visual Studio cannot write them any more:)
Good thing, it seems that this files will be unlocked soon. Here is the logic implemented in GNU Make which allows to retry the compilation
if that specific type of error happens.

Woks for:

✔ GNU make 3.7x
✔ windows XP

Should also work for:

✔ most windows and unix versions
✔ older or newer GNU make versions

Basically, I can chain commands inside of GNU make. I can execute the second command only if the first has failed or if the first was successful.

That gives me an option to do something like:

$(COMPILE) || $(VALIDATE_ERROR) && $(WAIT_ON_PDB_ERROR) && \
$(COMPILE_AGAIN) ... etc

And in GNU make syntax, it will be something like

$(MAKE) -f makecommand.mk --no-print-directory all > error.log || $(MAKE) -f grepcommand.mk --no-print-directory all && $(ECHO) pdb/ pch problem, wll wait for 180 sec and retry && $(SLEEP) 180 && \
$(MAKE) -f makecommand.mk --no-print-directory all > error.log || $(MAKE) -f grepcommand.mk --no-print-directory all && $(ECHO) pdb/ pch problem, wll wait for 180 sec and retry && $(SLEEP) 180 && \
$(MAKE) -f makecommand.mk --no-print-directory all > error.log || $(MAKE) -f grepcommand.mk --no-print-directory all && $(ECHO) pdb/ pch problem, wll wait for 180 sec and retry && $(SLEEP) 180 && \
$(MAKE) -f makecommand.mk --no-print-directory all

where:

>less grepcommand.mk
.PHONY all:
	grep "vc60\.pch\|vc60\.pdb" error.log

and

>less makecommand.mk
.PHONY all:
	$(CC) /nologo $(INCLUDE_FILES) $(C_FILES)

The code is not complete here, but you can easily fill the blanks. I have successfully solved the problem in huge make build chain of our enterprise with this one;)

Here is also some info about this error:
http://support.microsoft.com/kb/195386

have fun

Be Sociable, Share!
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: -2 (from 2 votes)
0 votes 'YES'  2 votes 'NO'


TAGS
No tags for this post.

SOCIAL
Be Sociable, Share!

INCOMING SEARCH TERMS


Leave a Reply