Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Delphi says 'cannot resolve unit name xxx'?

I'm working with Delphi2010 Enterprise Update 4.
When I'm opening my project in the IDE and displaying the mainform code, there are 2 unit names underline in red.

xxx http://img268.imageshack.us/img268/6475/unitnameunresolved.png.

I have verified that the path to the unit source is in the Library path and in the Browsing path.

Surprisingly, when I'm doing a right-clicking on the unit and selecting Open file at cursor, it works (ie. delphi opens the right unit).

Any idea about that ?

like image 728
TridenT Avatar asked Nov 24 '10 09:11

TridenT


1 Answers

Just disable Error Insight (Tools -> Options -> Editor Options -> Code Insight, uncheck Error Insight). It works fine for me.

Source: http://codeverge.com/embarcadero.delphi.ide/cannot-resolve-unit-name-forms/1041789

This is a cosmetic issue only, and doesn't affect your application in any way.

It's caused by a bug in the compiler used for Error Insight (the functionality that gives you the wavy red lines), which is not the same compiler used to build your application or to compile from the command line. The bug has existed since Error Insight was first introduced. (It has gotten less frequent, though; it used to be that the first thing I would do when I installed Delphi was to disable Error Insight, and I haven't had to do that with either D2007 or D2009 as the problem is very infrequent and do esn't seem to last long for whatever reason.)

Since there really isn't a problem (other than the cosmetic issue), you can either ignore it or get rid of it by disabling Error Insight (Tools -> Options -> Editor Options -> Code Insight, uncheck Error Insight).

like image 64
Mikhail Aksenov Avatar answered Nov 11 '22 08:11

Mikhail Aksenov