Jump to content
sorinh

Indy components error

Recommended Posts

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
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

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
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

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

Untitled.jpg

Share this post


Link to post
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 by Remy Lebeau

Share this post


Link to post

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×