Why are my units “compiled with a different version” of my own files?

前端 未结 14 1910
误落风尘
误落风尘 2020-12-16 16:22

I\'m building a program that uses plugins. Unfortunately, the plugin framework\'s dynamic linking forces the RTL and VCL out of my project EXE and into the BPL versions, an

14条回答
  •  有刺的猬
    2020-12-16 17:12

    The error "unit is compiled with a different version of..." is an annoying one. It occurs in a situation like below:

         +--------+
         | unit A |
         +--------+
          |      |
          |      |
          V      |
      +--------+ |
      | unit B | |
      +--------+ |
          |      |
          |      |
          V      V
         +--------+
         | unit C |
         +--------+
    

    Both unit A and B use unit C and unit B uses C. Unit B and C are compiled and for some reason the source of unit B is not available. Now Unit C is changed (any change will do and is recompiled) And the dcu of unit C differs from the unit C used by unit B, so unit B needs to be recompiled too. But unfortunately, the source is not available so the compiler gives up.

    It is not entirely clear what's wrong with your situation.

    You have a test framework that links to the plugins. So where do unit X and Y fit in and do you recognize the pattern shown above?

    But the fact that a complete build solves the problem is hint in this direction. And this is not the first time I saw problems with partial recompiles. So I always use the complete version.

提交回复
热议问题