I have seen similar questions and I've examined them but I didn't solve any problem.
I have all the sources and the error is about two units I've written myself and they are both in the main directory of my app. I've been having the problem since I used the template method of writing classes.
Here's the situation with my app: I wrote a new unit for implementing link list for any kind of object so I wrote TLinkList<T> = class
which works perfectly fine. Since the time I wrote this class, I'm having this problem. It doesn't compile in normal situations and what I have to do is to comment some of the code in ApFileIO
unit and compile the program, and then uncomment the code again!
I'm tired of commenting and uncommenting my codes, so I was wondering if there is anyway to fix this error.
Thx in advance.
Asked
Active
Viewed 694 times
0

David Heffernan
- 601,492
- 42
- 1,072
- 1,490

Javid
- 2,755
- 2
- 33
- 60
-
Even the [`F2051 error`](http://docwiki.embarcadero.com/RADStudio/XE3/en/F2051_Unit_%25s_was_compiled_with_a_different_version_of_%25s.%25s_(Delphi)) reference didn't help ? – TLama Apr 01 '13 at 18:39
-
No it didn't, because the sources are available and it's a very simple compile. I just don't get why this error happens for my project O_O – Javid Apr 01 '13 at 18:43
-
Do you have any packages? Is `ApCollections` in one of your packages? – David Heffernan Apr 01 '13 at 18:47
-
Yes it's used in one of my packages. Both my package and my main application use this unit. Delphi doesn't compile my package either showing the same error. – Javid Apr 01 '13 at 18:51
-
Are there multiple copies of `ApCollections.dcu` on your machine? – David Heffernan Apr 01 '13 at 19:00
-
No, just one. By the way, when I clean the directory and I click compile, I can see `ApCollections.dcu` created in the directory, but not `ApFileIO.dcu`. – Javid Apr 01 '13 at 19:09
-
If there's only one version of `ApCollections.dcu` then you would not see that message. – David Heffernan Apr 01 '13 at 19:17
-
None of the ideas [here](http://stackoverflow.com/q/429275/62576) helped? – Ken White Apr 01 '13 at 19:18
-
Which Delphi version? The link Ken gave you fingered the rather poor quality generics code in the original release, D2009. – David Heffernan Apr 01 '13 at 19:23
-
I'm using XE. This problem is driving me crazy. I'm taking a look at the ideas... – Javid Apr 01 '13 at 19:26
-
I examined the link Ken gave. I've tried them all in the past. BTW I'm using `IDE Fix Pack 5.1` – Javid Apr 01 '13 at 19:32
-
Try adding a different DCU subdirectory for each of your debug and release builds. – Warren P Apr 01 '13 at 21:28
-
I don't really build my app with release config, because it's has a long way for being published, so I always use Debug config. BTW I don't know why I face problems in big projects in Delphi. My current project is 60000 lines of code up to now and I need to clean the source directory every now and then or otherwise IDE hangs while working with sources of my project. – Javid Apr 02 '13 at 17:37
1 Answers
0
Believe it or not, the problem is solved by not using inline
functions.
I removed inline
directives of unit ***
(which is mentioned in the question subject) and ApCollections
. This solved the problem.
Thank you everybody for helping.

Javid
- 2,755
- 2
- 33
- 60