1
votes

After uninstalling Delphi 10 Seattle, removing all directories containing 'Embarcadero', then installing Delphi 10.2 Tokyo, my projects using Indy no longer compile:

Could not compile used unit 'IdSSLOpenSSLHeaders'
  • Nothing changed in the projects' search path (these are only relative to the project)
  • Tools/Delphi Options/Library/Browsing path contains $(BDS)\source\Indy10\Protocol (and Core and System), and IdSSLOpenSSLHeaders.pas is in c:\Program Files (x86)\Embarcadero\Studio\19.0\source\Indy10\Protocols\
  • Adding IdSSLOpenSSLHeaders to the uses clause does not help (12 other Indy file names were added automatically because I used design time components)
  • There is a TIdSSLIOHandlerSocketOpenSSL component on the form
  • There is nothing relating to Indy in the Tools/Delphi Options/Library/Library Path
  • IdSSLOpenSSLHeaders.dcu etc. are in the c:\Program Files (x86)\Embarcadero\Studio\19.0\lib\win32\release\ folder
  • The editor shows red wigglies under IdSSLOpenSSL in the Uses clause, with hint 'Cannot resolve unit name'
  • There are no old id*.dcu files in unexpected places on the disk

I found two workarounds that I'm both not particularly happy with:

  1. The Indy files are not part of the project; explicitly adding IdSSLOpenSSLHeaders.pas to the project makes it compile again, but I'm not happy about that: IdSSLOpenSSLHeaders.pas now compiles in that source directory, leaving a .dcu file there.
    Besides, all the other Indy files are not part of the project.

  2. Copying IdSSLOpenSSLHeaders.pas and IdCompilerDefines.inc to my projects' directory

Is there a better solution that I'm overlooking?

I am trying to create a small project to reproduce the issue, but so far this compiles???

1

1 Answers

0
votes

Found it.

There were two projects involved, with some common files. Whichever one of the two I tried to build, I got the error.

The solution was to delete all .dcu files local to both projects.

Don't ask me why, but it seems there was some (order?)* dependency that building either one was unable to resolve.
After this, the order in which I build does not matter.

Note: I was thinking about deleting my question because this is such a weird and unreproducable issue (a test program I was gradually complicating kept compiled without errors).
Instead I decided to self-answer; who knows who this may help in the future.

* While trying, I even tried changing the order of the file names in the Uses statement, but that did not help.