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

前端 未结 14 1911
误落风尘
误落风尘 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 16:55

    This happens to me very often when I forget to change the DPK Build control from Rebuild as needed to Explict rebuild in Options...|Description.

    0 讨论(0)
  • 2020-12-16 16:56

    Check that you don't have an strained old dcu file somewhere in source dir.

    0 讨论(0)
  • 2020-12-16 16:57

    my case and solution:

    • we had a main application that builds an exe file and
    • some plugin projects that build dll files for this exe
      (the dll project also needs some of the applications source files)

    sometimes when compiling the dll files the "was compiled with a different version" problem occurred

    the problem was this:

    • the exe project was setup to create all it's dcu files in a separate directory: e.g. App\DCUs
    • the dll project had this DCUs directory in the search path, but also some of the application's source directories: e.g. App\Utils, App\Core, etc.
    • thus, when you compiled the dll project, some of the applications source files were compiled again (now possibly with a different version of other dependencies):
      and we ended up with 2 different dcu's of the same *.pas file

    the solution is easy: remove the App\DCUs directory from the dll project's search path.

    0 讨论(0)
  • 2020-12-16 17:00

    I hate this problem. I find it pops up every now and then and although it sounds in your case to be directly related to what you are doing with plugins, I've solved this in the past by finding and deleting all the dcus, bpls and dcps of the packages that we've written and then rebuilding the packages.

    0 讨论(0)
  • 2020-12-16 17:02

    Definitely something buggy with the compiler. I have found that altering the order of the units in the uses clause will allow you to get "one free compilation" in. After that, the error re-occurs and your back to rebuilding. :-(

    0 讨论(0)
  • 2020-12-16 17:04

    Unit ppParameter was compiled with a different version of ppRelatv. TppRelative :

    Delete all .dcu in your program folder / your computer, then re-compile or re-build again. Then your program will running well again.

    0 讨论(0)
提交回复
热议问题