Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 6 - Bugs disappear when I compile multiple times

My Delphi installation has been going downhill for the past few months. It seems though that every so often when I build a release it has strange errors in it which are resolved if I build, then compile, then build, compile, etc.

I've talked to another developer who thinks that this is a compiler error. This sort of degrading performance over time has happened on other computers to us too.

What does stack overflow think could be the problem.

like image 523
Daisetsu Avatar asked May 04 '10 17:05

Daisetsu


2 Answers

What I've seen most is a case where multiple versions of the same units/dcus exist in different folders/paths, and depending on almost insignificant variations the compiler/linker uses a different path and picks different versions of the units to build the exe.
I would make a huge Spring clean-up, scrutinize the lib/search paths, remove all dcus and make sure there is no duplicate versions of any unit.
And, agreed, reinstalling Delphi could help start with a clean state.

like image 82
Francesca Avatar answered Nov 15 '22 03:11

Francesca


I agree with @François about the DCUs, but also want to point out an observation: sometimes it matters what was built prior to what you're building. i.e. if you have several projects that contain source code that results in various .dcu/bpl files being created in a common directory, but the project that you're concerned with doesn't explicitly call for them to be rebuilt, then you're going to end up with whatever is there. If you clear the dcus/dcps prior to building, and then find that your project doesn't build, then you are missing a uses/requires clause somewhere. Every project shoudl be able to build on a "clean slate", and not rely on leftover binaries.

like image 33
Chris Thornton Avatar answered Nov 15 '22 04:11

Chris Thornton