sorinh 0 Posted December 10, 2023 Hi. I recently installed Delphi 10.1 on a new PC and transferred some old applications that use Indy clients and server components. However, some of these applications are not functioning properly and throw an error message saying "Could not compile used unit 'Id....'" or "Cannot resolve unit name 'Id...'". Can you help me identify what I might be missing? Share this post Link to post
Remy Lebeau 1436 Posted December 10, 2023 6 hours ago, sorinh said: I recently installed Delphi 10.1 on a new PC and transferred some old applications that use Indy clients and server components. However, some of these applications are not functioning properly and throw an error message saying "Could not compile used unit 'Id....'" or "Cannot resolve unit name 'Id...'". Can you be a little more specific? What are the full error messages? Are you trying to use the version of Indy that ships preinstalled with the IDE (it should "just work" out of the box), or did you replace it with a newer version of Indy? Share this post Link to post
sorinh 0 Posted December 11, 2023 I am using Indy version 10.6.2.5341 which was pre-installed with my IDE. When I tried to compile some old applications, I encountered an error message which says: '[dcc32 Fatal Error] Main.pas(25): F2063 Could not compile used unit 'IdSMTP.pas'. It's strange because other old applications or new ones compile without any issues. All the applications are in the same Delphi 10.1 environment. Can you help me with this issue? - Sorin" Share this post Link to post
Remy Lebeau 1436 Posted December 11, 2023 11 hours ago, sorinh said: I am using Indy version 10.6.2.5341 which was pre-installed with my IDE. When I tried to compile some old applications, I encountered an error message which says: '[dcc32 Fatal Error] Main.pas(25): F2063 Could not compile used unit 'IdSMTP.pas'. Is there more to the error message? I would think it would tell you WHY it can't compile the unit. In any case, it sounds like the project is trying to recompile Indy from its source code. Does the project refer to Indy's source code folder directly? It shouldn't, so if it does then remove that folder from the project's search directories. The project should only be using the pre-installed unit/package binaries that were already compiled for the IDE. Share this post Link to post
sorinh 0 Posted December 12, 2023 No, only what I sent. I attached a screenshot with the error. How can I check if I am referred directly? If by the project search directory you mean "Project > Options > Search Path", then this set is empty. Sorin Share this post Link to post
Remy Lebeau 1436 Posted December 12, 2023 (edited) 1 hour ago, sorinh said: If by the project search directory you mean "Project > Options > Search Path", then this set is empty. No, I was actually referring to the compiler's Library and Browsing Paths, the debugger's Source Path, etc. There are multiple search paths in a project, make sure none of them are referring to Indy's source folder during compiling. You don't want the compiler finding Indy's source code if you want to use the pre-installed version. You said you re-installed the IDE and transferred over old projects. Do you have the same problem if you start a new project fresh? What IDE version were the old projects written in? It is generally a good idea to create a new project in the new IDE and then add your existing source files to the new project as needed, rather than just open an old project in the new IDE. Edited December 12, 2023 by Remy Lebeau Share this post Link to post
sorinh 0 Posted December 17, 2023 Thank you for your support, Remy. I have compared the search paths in the settings option and they appear to be the same. The issue only occurs when I am working on an old project. New programs work ok. All of my projects are using the Delphi 10.1 version. I have recently reinstalled Delphi 10.1 on a new computer and migrated all the programs from my old computer. However, I have made another check and added a new IdSMTP component to an old program, which worked perfectly fine. But when I added the same component to another old program and placed the cursor on the IdSMTP unit in the text, an error message appeared stating that it "cannot resolve unit name 'IdSMTP'". Sorin Share this post Link to post
sorinh 0 Posted December 19, 2023 Hello, I wanted to let you know that the problem has been resolved. I deleted all the compiled .dcu files and rebuilt everything; now it works. Thank you for being so supportive. Share this post Link to post