How do I fix this annoyance?

Whenever I install a new component, I get the message...

Unit ..... is implicitly imported into .....

What can I do to get rid of this?

Thanks,

John.
LVL 6
JaymolAsked:
Who is Participating?
 
LischkeConnect With a Mentor Commented:
Well, if Thaddy isn't interested...
0
 
ThaddyCommented:
You can Explicitly import the unit!
I wouldn't bother, the message just indicates a dependancy
0
 
LischkeCommented:
Jaymol, this warning is shown because you cannot include a unit in a package if it is already included in another one. This holds also true for implicitly imported units. But if the unit in question is not explicitly imported then you may have a hard time to find out why you cannot import it into another package. Hence this warning is shown to remind you to take the unit into the package to see from the file list which unit is already there.

Generally (hint also for Thaddy), don't ignore warnings or even hints from the compiler. They make to 99% sense and saved me often hours of work to find bugs!

Ciao, Mike
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
JaymolAuthor Commented:
Sorry Thaddy, but like I said, I want to get rid of this.  I need to know how.
0
 
LischkeCommented:
John,

the solution is to open the package in Delphi. Then click Add in the package window and select the unit(s) in question. After pressing ok they should now appear in the list of files in the package. Compile the package now...

Ciao, Mike
0
 
JaymolAuthor Commented:
Mike : That's the way I add units/components, but when I compile the package I get the warnings.  I know they don't stop the code working, but I'd love to be able to click the compile button and not be shown any warnings!

John.
0
 
LischkeCommented:
So you don't want to include the units into your package but still compile without warnings? Why? There's no harm to do this and you cannot switch off the warnings as in C/C++. Hence either you ignore them or you include the units.

Ciao, Mike
0
 
JaymolAuthor Commented:
How would I include the units to get rid of these warnings then?
0
 
LischkeCommented:
Somehow I got the impression we are talking different lines :-) So here again the problem and my suggestion:

1) you have a package that you want to isntall (that is, a *.dpk file and some accompanying units)
2) you open the dpk file in Delphi and press Compile
3) you get the warnings about implicitly imported units

So far the problem, now my solution:

1) look at the warnings list to know which units are implicitly imported
2) add these units also to the package the usual way
3) now press again Compile
4) the warnings should now disappear

Ciao, Mike
0
 
philipleighsCommented:
Isn't that what Thaddy said?

"Explicitly import the unit!"
0
 
LischkeCommented:
Yes :-) but he also mentioned to ignore the warning. So (despite the fact that I made the discussion here) Thaddy should get the points for first mentioning the solution...

Ciao, Mike
0
 
JaymolAuthor Commented:
Thaddy....post something for the points.  (Sorry it's been so long!)
0
 
LischkeCommented:
just use "accept comment as answer" so you don't need to wait for an answere to be proposed...

Ciao, Mike
0
 
JaymolAuthor Commented:
Lischke : I can't do that because the only thing on this page that Thaddy posted was a rejected answer.  I need another comment or answer to give him the points.
0
 
JaymolAuthor Commented:
Yeah.  Go on then.  Just remember this Mike. (I even rated it as excellent! ;-)
0
 
LischkeCommented:
:-)=  thanks
0
All Courses

From novice to tech pro — start learning today.