PDA

View Full Version : I can compile, but not repeatedly.



masonwheeler
19-01-2009, 11:24 PM
System: Windows XP Home
Compiler/IDE: Delphi 2009
API: Win32

I'd like to publish my TURBU project as an open-source project, but recently a serious glitch has crept into the project's structure and I can't figure it out.

There are no syntax errors in my code. When I do a full build (SHIFT-F9) it will compile just fine.

When I hit F9 or CTRL-F9 to compile without a full build:

[DCC Fatal Error] turbu_database.pas(1155): F2051 Unit turbu_skills was compiled with a different version of turbu_database.GDatabase

First off, 1155 is an invalid line. The file ends at 1152. Second, as I understand it, this error is only supposed to occur when you're trying to compile something and you're missing the source files and only have DCUs. This is not the case for the two files it mentions, or any file in my project, for that matter. I have the source to everything except midas, which is used by TClientDataset, but that shouldn't have anything to do with the units in question.

The project will build just fine, so whatever the problem is is caused by the compiler overlooking something in normal-compile mode. Just to make things worse, for some reason this morning it started wanting to recompile every time I hit Run, even if I hit it immediately after a full build, without making any changes. (That had been my workaround for a while now.) It's now impossible to run my project in the IDE. I don't know why it started doing that. I didn't make any significant changes to my project.

This is putting a serious kink in my development. Does anyone know what's going on and how to fix it?

The source can be found at http://www.turbu-rpg.com/downloads/Turbu_source_setup.exe if anyone wants to test it. It requires Delphi 2009 with the JVCL already installed; the installer package will take care of the rest. Maybe having the source code available will help someone track this down. I certainly hope so, because wherever the issue is, it's beyond me. The problem can be found in testing.exe and also in turbu.exe in turbu.groupproj.

Pyrogine
19-01-2009, 11:47 PM
Check your path. It maybe picking up a compiled unit from a different path. I almost went nuts with a problem like this a while back. Sigh. In my case the compiler was picking up a .dcu of the same unit in my current project because the path was first in the list.

masonwheeler
20-01-2009, 02:27 AM
That was the first thing I checked. The filenames are unique.

tpascal
20-01-2009, 03:38 PM
yes,
do a full search of turbu_database.pas and turbu_database.dcu, most likeli there is more that one of any those file in the path

masonwheeler
20-01-2009, 05:07 PM
Nope. Like I said, that was the first thing I checked. It's not the problem here.

Memphis
23-01-2009, 05:44 PM
did you try to delete all your dcu's and all temp files? then do a fresh build?

create a bat file containing



del *.~*
del *.ddp
del *.dcu



execute that then try to a new build.

;MM;

masonwheeler
24-01-2009, 08:23 PM
Yep. Deleting those files allows me to compile successfully, one time. Then the problem comes back. (Seriously, if any of the obvious solutions to this problem worked, I wouldn't have to post about it here, asking for help, now would I?)

VilleK
24-01-2009, 08:36 PM
I remember having problems like that when some used units were not part of the project that was being built. So make sure all your unit source files are included in the dproj-file using add to project.

Memphis
25-01-2009, 02:51 PM
Yep. Deleting those files allows me to compile successfully, one time. Then the problem comes back. (Seriously, if any of the obvious solutions to this problem worked, I wouldn't have to post about it here, asking for help, now would I?)

maybe, but stating the obvious is important with anyone, as you never know what sort of person is sitting on the other side of the forum lol.

noeska
25-01-2009, 07:31 PM
i did no look at the source (i dont like exe's), but:
does your dpk have the name of a .pas file? If so try to correct that.

masonwheeler
26-01-2009, 05:10 PM
i did no look at the source (i dont like exe's), but:
does your dpk have the name of a .pas file? If so try to correct that.
Nope. Actually, after a fair amount of digging around, it's starting to look like this is a cross-unit-generics issue. D2009's compiler has several issues with generics not matching up right under certain circumstances when it's declared in one unit and used in another. I've been able to code a workaround, thankfully.

noeska
26-01-2009, 06:16 PM
Not everyone is yet using delphi2009. Dont know if freepascal can use generics...

JSoftware
26-01-2009, 09:38 PM
Not everyone is yet using delphi2009. Dont know if freepascal can use generics...
The undocumented generics in the latest release(not release candidate. 2.2.2 I think) works sometimes, but not the same way as Delphi2009's AFAIK

masonwheeler
27-01-2009, 12:19 AM
I've been using generics quite a bit, especially the generic TList and TDictionary classes. They make things so much easier! (Except for the few times when you end up butting your head up against a flaw in the compiler.)