Delphi ошибка could not compile used unit

I have written 2 packages: MEComps_DXE5 and AMLComps_DXE5. The latter depends on the former. Both should be multi-platform: Win32, Win64, and (in the future) OSX.

When I open the first package MEComps_DXE5, I am able to compile it, build it and install it. I get some warnings, as this library contains code that must also compile on old D5, but the build succeeds and creates the dcu and dcp files where expected.

When I open the second package AMLComps_DXE5, I find this situation:

  • If I do not declare the dependency on MEComps_DXE5, the package will compile and build correctly (no errors, dcu and dcp files are generated), but Delphi will warn me that it has implicitly imported units from MEComps_DXE5, and ask me to add the package to the dependency list (Requires)
  • If the dependency is declared, then the compilation will fail with "[dcc32 Fatal Error] MEComps_DXE5.dpk(52): F2063 Could not compile used unit 'MEClasses.pas'", where MEClasses is the first unit of the MEComps_DXE5 package.

I’ve been trying to solve this for a few days now, but to no avail. I’m working on two fronts:

  • Why is Delphi even trying to compile the other package? I have just built and installed it, and have all dcus and the dcp.
  • Why is the compilation failing?

As to the first question I have no clue whatsoever.

As to the second question, the documentation is useless in this case. It explains why not being able to compile a used unit is fatal, and states that the cause is determined by looking at the previous errors. But in this case, there are NO previous errors.

As MEComps_DXE5 actually compiles and builds on its own, I doubt this has anything to do with syntax or code. It would seem to be that the compiler is not able to find something it needs to compile those units.

The two packages reside each in their own directory. I put the MECompsWin32 dcu directory on the library path and on the browsing path. The IDE actually has no problems looking up the used units.

I also checked the dcc32 command line and it seems that all envolved directories are known to the compiler.

Other info I can add:

  • Both packages have their own include file (in their source directory). I’m not sure if these are to be included in the package contains list or not, but I’ve tried both ways and nothing seemed to change.
  • Both packages have a corresponding Delphi 5 package which includes some of the same units and code (different dpk though). These compile and build correctly. Delphi 5 dcu files are generated in the source directory. Can this create problems with the XE5 compiler?
  • Here is the complete code for the MEComps_DXE5 package. I see a lot of compiler directives that Delphi inserted when it created the empty package. I didn’t touch those:
        package MEComps_DXE5;

    {$R *.res}
    {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
    {$ALIGN 8}
    {$ASSERTIONS ON}
    {$BOOLEVAL OFF}
    {$DEBUGINFO ON}
    {$EXTENDEDSYNTAX ON}
    {$IMPORTEDDATA ON}
    {$IOCHECKS ON}
    {$LOCALSYMBOLS ON}
    {$LONGSTRINGS ON}
    {$OPENSTRINGS ON}
    {$OPTIMIZATION OFF}
    {$OVERFLOWCHECKS OFF}
    {$RANGECHECKS OFF}
    {$REFERENCEINFO ON}
    {$SAFEDIVIDE OFF}
    {$STACKFRAMES ON}
    {$TYPEDADDRESS OFF}
    {$VARSTRINGCHECKS ON}
    {$WRITEABLECONST OFF}
    {$MINENUMSIZE 1}
    {$IMAGEBASE $400000}
    {$DEFINE DEBUG}
    {$ENDIF IMPLICITBUILDING}
    {$IMPLICITBUILD ON}

    requires
      rtl,
      fmx,
      dbrtl,
      xmlrtl;

    contains
      MEClasses in 'MEClasses.pas',
      MEConsts in 'MEConsts.pas',
      MEDataReader in 'MEDataReader.pas',
      MEDateUtils in 'MEDateUtils.pas',
      MEEncoding in 'MEEncoding.pas',
      MEEncodingISO2022 in 'MEEncodingISO2022.pas',
      MEFileUtils in 'MEFileUtils.pas',
      MELists in 'MELists.pas',
      MEMath in 'MEMath.pas',
      MENumUtils in 'MENumUtils.pas',
      MESQLUtils in 'MESQLUtils.pas',
      MEStrUtils in 'MEStrUtils.pas',
      MESysUtils in 'MESysUtils.pas',
      METypes in 'METypes.pas',
      MEURIUtils in 'MEURIUtils.pas',
      MEXMLUtils in 'MEXMLUtils.pas';

    end.

0 / 0 / 0

Регистрация: 04.08.2018

Сообщений: 40

1

Не удалось скомпилировать использованный модуль

13.01.2020, 17:09. Показов 3653. Ответов 8


Студворк — интернет-сервис помощи студентам

Я не могу запустить свой код, ибо прога выдает ошибку: [Fatal Error] Project1.dpr(5): Could not compile used unit ‘Unit1.pas’
Как это можно пофиксить?
p.s. вот фотка из папки, где находится прога
upd.
Попытался создать все в другом файле, ну вот и получил новую ошибку
Eror in module Unit1: Declaration of class TForm 1 is missing or incorret

Миниатюры

Не удалось скомпилировать использованный модуль
 



0



пофигист широкого профиля

4662 / 3096 / 855

Регистрация: 15.07.2013

Сообщений: 17,864

13.01.2020, 17:13

2

Значит ошибки в коде ‘Unit1.pas’.
Внимательно читайте сообщения компилятора.



0



Житель Земли

2999 / 2998 / 391

Регистрация: 26.07.2011

Сообщений: 11,459

Записей в блоге: 1

13.01.2020, 17:28

3

Цитата
Сообщение от Alchemist-FF
Посмотреть сообщение

вот фотка из папки, где находится прога

То есть фотка, А НЕ КОД, должна помочь в постановке диагноза!
Мне интересен ход мыслей, приведший к подобному выводу



1



Модератор

3395 / 1964 / 711

Регистрация: 15.11.2015

Сообщений: 7,854

13.01.2020, 17:37

4

Не по теме:

Правлю код по фотографии папки с проектом.

Добавлено через 38 секунд

Цитата
Сообщение от Alchemist-FF
Посмотреть сообщение

Как это можно пофиксить?

Исправить ошибку в коде.



0



Житель Земли

2999 / 2998 / 391

Регистрация: 26.07.2011

Сообщений: 11,459

Записей в блоге: 1

13.01.2020, 17:51

5

Цитата
Сообщение от Alchemist-FF
Посмотреть сообщение

[Fatal Error] Project1.dpr(5): Could not compile used unit ‘Unit1.pas’

сам по себе Fatal Error не информативен. Он всегда является следствием ошибки где-то в указанном модуле (как правило, компилятор указывает номер строки с ошибкой). Ищи строку с [Error] выше в отчёте компилятора

Цитата
Сообщение от Alchemist-FF
Посмотреть сообщение

Eror in module Unit1: Declaration of class TForm 1 is missing or incorret

вот это уже ближе к истине. Почитай внимательно оригинал этого сообщения и определи, в какой строке ошибка



0



Житель Земли

2999 / 2998 / 391

Регистрация: 26.07.2011

Сообщений: 11,459

Записей в блоге: 1

13.01.2020, 17:58

6

Вот тебе небольшая демонстрация поведения компилятора

Миниатюры

Не удалось скомпилировать использованный модуль
 



0



Нарушитель

8606 / 4610 / 1064

Регистрация: 12.03.2015

Сообщений: 21,685

13.01.2020, 18:11

7

Пробел удали, писарь.



0



Житель Земли

2999 / 2998 / 391

Регистрация: 26.07.2011

Сообщений: 11,459

Записей в блоге: 1

13.01.2020, 23:11

8

Verevkin, ты хоть цитируй. Я-то подозреваю, где лишний пробел, но, может быть, твоё замечание для ТС…



0



Нарушитель

8606 / 4610 / 1064

Регистрация: 12.03.2015

Сообщений: 21,685

13.01.2020, 23:28

9

Цитата
Сообщение от DenNik
Посмотреть сообщение

ты хоть цитируй. Я-то подозреваю, где лишний пробел, но, может быть, твоё замечание для ТС…

Узбагойзя.

Не удалось скомпилировать использованный модуль



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

13.01.2020, 23:28

9

Claus Nielsen

Newbie
Newbie
Posts: 24
Joined: Mon Feb 25, 2008 12:00 am

F2063 Could not compile used unit ‘Tengine.pas»

Hi,
I get the error F2063 Could not compile used unit ‘Tengine.pas» in D2009 when I try to compile my program without the «Build with runtime packages» checked. Small wonder, since I do not have the Tengine.pas (or Chart.pas etc.) in my TeeChart 8.06 for Delphi 2009 directory. Am I a non-source code customer (cannot see from your info whether I am or not)? — or did I miss something? The TeeChart components come up on the Tool Palette and everything is working fine when I check the «Build with runtime packages» before compiling.
Thank you in advance
Claus


Pep

Site Admin
Site Admin
Posts: 3251
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Pep » Mon Dec 07, 2009 10:23 am

Hi Claus,
I think the problem is related with the search path option of your project. Make sure you have all the TeeChart Pro VCL paths ( lib, etc.. ) added correctly to your project options (Search path), try to post them at the first position into the list of paths. This should fix the problem.
Check also the menu -> Tools -> Environment Options -> Library -> Library Path , it should contain the lib path of the TeeChart Pro vcl version.

I’ve also checked which license version you already have, it’s the VCL version without source-code.


Claus Nielsen

Newbie
Newbie
Posts: 24
Joined: Mon Feb 25, 2008 12:00 am

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Claus Nielsen » Tue Dec 08, 2009 4:48 pm

Hi Josep,
In Tools -> Options -> Environment Options -> Library — Win32 -> Library Path, I now have C:Program FilesSteema SoftwareTeeChart 8.06 for Delphi 2009Delphi12Lib, C:Program FilesSteema SoftwareTeeChart 8.06 for Delphi 2009Delphi12Bin, C:Program FilesSteema SoftwareTeeChart 8.06 for Delphi 2009Delphi12Lib, C:Program FilesSteema SoftwareTeeChart 8.06 for Delphi 2009Delphi12Include, C:Program FilesSteema SoftwareTeeChart 8.06 for Delphi 2009Delphi12QuickReport and C:Program FilesSteema SoftwareTeeChart 8.06 for Delphi 2009Delphi12System in addition to all the usual stuff (and listed first!).

This is pretty much all there is in the directory C:Program FilesSteema SoftwareTeeChart 8.06 for Delphi 2009Delphi12.

This is Delphi 2009, so in Project -> Options -> Resource Compiler -> Directories and conditionals, the search path is the same as in the Environment Options above.

Still, if I uncheck the «Build with runtime packages» in Project -> Options -> Resource compiler -> Packages, and try to compile I get the error: F2063 Could not compile used unit ‘Chart.pas’.

— Why does the compiler want a .pas file for compiling?

regards
Claus


Claus Nielsen

Newbie
Newbie
Posts: 24
Joined: Mon Feb 25, 2008 12:00 am

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Claus Nielsen » Tue Dec 08, 2009 5:51 pm

Dear Josep,
If you cannot see where the problem is with my F2063-error, then maybe I should upgrade From verion 8 Pro without source code to version 8 Pro with source code. Your ordering page does seem to have this option available, so how can I order this particular upgrade?
regards
Claus


Narcís

Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Narcís » Wed Dec 09, 2009 9:13 am

Hi Claus,

If you cannot see where the problem is with my F2063-error, then maybe I should upgrade From verion 8 Pro without source code to version 8 Pro with source code.

Source code license should not be necessary for solving that. Most likely your Delphi is still referencing TeEngine unit included with it. Please check that no old TeeChart packages are referenced at Project->Options->Packages too.

Your ordering page does seem to have this option available, so how can I order this particular upgrade?

If you still want to do so please contact our Sales Dept. at sales at steema dot com.

Thanks in advance.


Claus Nielsen

Newbie
Newbie
Posts: 24
Joined: Mon Feb 25, 2008 12:00 am

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Claus Nielsen » Wed Dec 09, 2009 11:38 am

Dear Narcis,
The only relevant packages at Project -> Options -> Packages are «TeeChart 8 Pro components» (in C:Program filesCodeGearRAD Studio6.0binDclTeePro812.bpl) and «TeeTree 2 Components» (in: C:Program filesCodeGearRAD Studio6.0binDclTree2D12Tee8.bpl). I copied these files to the C:Program filesCodeGearRAD Studio6.0bin directory, but can also reference them from the Teechart 8.06 for Delphi 2009Delphi12bin directory without any effect on the F2063-error, i.e. Delphi 2009 insists that it cannot find the Chart.pas file (or any other teechart .pas files, e.g. TeEngine.pas).
— Could the problem be related to other versions of TeeChart (I have it for Delphi 7 and for Delphi 2007 also on the same machine)?


Narcís

Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Narcís » Wed Dec 09, 2009 1:07 pm

Dear Claus,

Even if you copy the packages to Delphi’s «Bin» folder, are you also setting the search paths to TeeChart’s «bin» and «lib» folders? That’s necessary so that Delphi can find *.dcu files (Delphi compiled units files) for those required units.

Thanks in advance.


Claus Nielsen

Newbie
Newbie
Posts: 24
Joined: Mon Feb 25, 2008 12:00 am

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Claus Nielsen » Wed Dec 09, 2009 5:05 pm

Dear Narcis,
Yes, I have the search paths to both the bin and the lib subdirectories of C:Program FilesSteema SoftwareTeechart 8.06 for Delphi 2009Delphi12 in my Project Options Search path and in the library paths in Tools -> Options -> Environment Options -> Delphi Options -> Library — Win32 -> Library Paths.

The component palette shows the components OK (not the standard TeeChart components in Delphi 2009).

In the Project Options, The Teechart Pro 8 Components are selected (points to C:Program FilesSteema SoftwareTeechart 8.06 for Delphi 2009Delphi12binDclTeePro812.bpl).

Also in Project Options, the TeeTree2 components are selected (pointing to C:Program FilesSteema SoftwareTeechart 8.06 for Delphi 2009Delphi12binDclTree2D12Tee8.bpl).

There are no Teechart components for other versions in the lists.

I tried to repeat the setup after a new install of Delphi 2009 (same results) and after removal + new installation of the TeeChart 8.06 for Delphi 2009 (same result).

It seems that Delphi is very hooked on the idea that the .pas files should be compiled (e.g. TeEngine.pas). — I have the recommended files in the Windows32 directory, and the program compiles and runs smoothly when «Build with runtime packages» is checked (which is not what I want, since I distribute the .exe to others need everything to be compiled in one file).

Any ideas?
Claus


Claus Nielsen

Newbie
Newbie
Posts: 24
Joined: Mon Feb 25, 2008 12:00 am

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Claus Nielsen » Fri Dec 11, 2009 11:13 am

Hi,
I have now purchased the «with source code» version and set the search path to the ..source directory. And whoopi! the whole thing compiled and now runs smoothly. For reasons unknown it seems that delphi 2009 was not happy with the compiled sources supplied with the «without source code» version.
Claus


Narcís

Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: F2063 Could not compile used unit ‘Tengine.pas»

Post

by Narcís » Tue Dec 15, 2009 9:50 am

Dear Claus,

Thanks for your feedback. We are glad to hear you could solve the issue at your end. We investigated the issue here and got it working here. It was most likely some configuration problem with your Delphi and/or your project.


I have written 2 packages: MEComps_DXE5 and AMLComps_DXE5. The latter depends on the former. Both should be multi-platform: Win32, Win64, and (in the future) OSX.

When I open the first package MEComps_DXE5, I am able to compile it, build it and install it. I get some warnings, as this library contains code that must also compile on old D5, but the build succeeds and creates the dcu and dcp files where expected.

When I open the second package AMLComps_DXE5, I find this situation:

  • If I do not declare the dependency on MEComps_DXE5, the package will compile and build correctly (no errors, dcu and dcp files are generated), but Delphi will warn me that it has implicitly imported units from MEComps_DXE5, and ask me to add the package to the dependency list (Requires)
  • If the dependency is declared, then the compilation will fail with "[dcc32 Fatal Error] MEComps_DXE5.dpk(52): F2063 Could not compile used unit 'MEClasses.pas'", where MEClasses is the first unit of the MEComps_DXE5 package.

I’ve been trying to solve this for a few days now, but to no avail. I’m working on two fronts:

  • Why is Delphi even trying to compile the other package? I have just built and installed it, and have all dcus and the dcp.
  • Why is the compilation failing?

As to the first question I have no clue whatsoever.

As to the second question, the documentation is useless in this case. It explains why not being able to compile a used unit is fatal, and states that the cause is determined by looking at the previous errors. But in this case, there are NO previous errors.

As MEComps_DXE5 actually compiles and builds on its own, I doubt this has anything to do with syntax or code. It would seem to be that the compiler is not able to find something it needs to compile those units.

The two packages reside each in their own directory. I put the MECompsWin32 dcu directory on the library path and on the browsing path. The IDE actually has no problems looking up the used units.

I also checked the dcc32 command line and it seems that all envolved directories are known to the compiler.

Other info I can add:

  • Both packages have their own include file (in their source directory). I’m not sure if these are to be included in the package contains list or not, but I’ve tried both ways and nothing seemed to change.
  • Both packages have a corresponding Delphi 5 package which includes some of the same units and code (different dpk though). These compile and build correctly. Delphi 5 dcu files are generated in the source directory. Can this create problems with the XE5 compiler?
  • Here is the complete code for the MEComps_DXE5 package. I see a lot of compiler directives that Delphi inserted when it created the empty package. I didn’t touch those:
        package MEComps_DXE5;

    {$R *.res}
    {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
    {$ALIGN 8}
    {$ASSERTIONS ON}
    {$BOOLEVAL OFF}
    {$DEBUGINFO ON}
    {$EXTENDEDSYNTAX ON}
    {$IMPORTEDDATA ON}
    {$IOCHECKS ON}
    {$LOCALSYMBOLS ON}
    {$LONGSTRINGS ON}
    {$OPENSTRINGS ON}
    {$OPTIMIZATION OFF}
    {$OVERFLOWCHECKS OFF}
    {$RANGECHECKS OFF}
    {$REFERENCEINFO ON}
    {$SAFEDIVIDE OFF}
    {$STACKFRAMES ON}
    {$TYPEDADDRESS OFF}
    {$VARSTRINGCHECKS ON}
    {$WRITEABLECONST OFF}
    {$MINENUMSIZE 1}
    {$IMAGEBASE $400000}
    {$DEFINE DEBUG}
    {$ENDIF IMPLICITBUILDING}
    {$IMPLICITBUILD ON}

    requires
      rtl,
      fmx,
      dbrtl,
      xmlrtl;

    contains
      MEClasses in 'MEClasses.pas',
      MEConsts in 'MEConsts.pas',
      MEDataReader in 'MEDataReader.pas',
      MEDateUtils in 'MEDateUtils.pas',
      MEEncoding in 'MEEncoding.pas',
      MEEncodingISO2022 in 'MEEncodingISO2022.pas',
      MEFileUtils in 'MEFileUtils.pas',
      MELists in 'MELists.pas',
      MEMath in 'MEMath.pas',
      MENumUtils in 'MENumUtils.pas',
      MESQLUtils in 'MESQLUtils.pas',
      MEStrUtils in 'MEStrUtils.pas',
      MESysUtils in 'MESysUtils.pas',
      METypes in 'METypes.pas',
      MEURIUtils in 'MEURIUtils.pas',
      MEXMLUtils in 'MEXMLUtils.pas';

    end.

Типов сообщений компилятора — более двухсот. Рассмотрим перечень наиболее встречающихся сообщений класса Error

  • 0. <Что-то1> expected but <Что-то2> found. Обычно это сообщение возникает при синтаксической ошибке.Например,в случае небаланса скобок,компилятор сообщит: ‘)’ expected but ‘;’ found (вместо ожидавшейся скобки найдена запятая).

    Компилятор часто сообщает, что ‘end’ ожидается,например:x:= 5,7; здесь неуместен разделитель-запятая, а сообщается про end. (‘END’ expected but ‘,’ found)

  • 1. <Имя> is not a type identifier. Данное <Имя> не является именем типа.
  • 2. ‘;’ not allowed before ‘Else’. Перед else нельзя ставить точку с запятой
  • 3. Abstract method must be virtual or dynamic. Абстрактный метод должен быть виртуальным или динамическим.
  • 4. Ambiguous overloaded call to <Имя блока>. Компилятор не может однозначно выбрать перегружаемый блок. Измените параметр.
  • 5. Array type required. Ошибка возникает в случаях, когда в индексе элемента массива указано больше уровней, чем предусмотрено описанием, и если массив не описан. Например, после объявления двумерного массива х или простой переменной х ошибочно записывают элемент х[2,1,1] (в нем показано три измерения).
  • 6. Assignment to FOR-loop variable <Имя>. Присваивание значения параметру FOR-цикла в теле цикла.

    Например, вследствие описки дважды используется имя i в кратном цикле:

    For i:= 1 to n do For i:= 1 to m do ...
    
  • 7. Break or Continue outside of loop. Break или Continue — не в цикле.
  • 8. Cannot initialize local variables. Локальные переменные запрещено инициализировать (задавать им значения при описании).
  • 9. Cannot assign to/read a read-only/write-only property. Присвоение значения свойству read/only и чтение свойства write/only запрещены.
  • 10. Constant expression expected.В этом месте должна стоять константа или константное выражение, например константа выбора в структуре Case.
  • 11. Constant expression violates subrange bounds. Выход значения константы из диапазона. Контроль не полон. Например, «сойдет с рук» присваивание x:=3000000000, где х имеет тип integer, но начение х будет искажено.
  • 12. Constant or type identifier expected. Требуется имя типа или тип-диапазон.
  • 13. Could not compile used unit <Имя>. Компиляция присоединенного модуля <Имя> невозможна.
  • 14. Data type too large. Тип определяет структуру размером более 2 Гбайт; это слишком много.
  • 15. Declaration expected but <Что-то> found. Пропущено описание или оператор.
  • 16. Declaration of <Имя> differs from previous declarations… Данный заголовок блока не соответствует упреждающему объявлению блока.
  • 17. Default parameter <Имя> must be by-value or constant. Необязательный параметр (со значением по умолчанию) не должен вызываться по ссылке.
  • 18. Expression expected. В этом месте программы должно стоять выражение.
  • 19. Expression too complicated. Выражение излишне сложно для компиляции.
  • 20. File type not allowed here. В этом месте или в этой роли файловую переменную нельзя использовать. Например, она не может быть формальным параметром-значением.
  • 21. For loop control variable must be simple local variable. Параметр цикла должен быть простой локальной (описанной в этом же блоке) переменной.
  • 22. For loop control variable must have ordinal type. Параметр цикла должен иметь порядковый тип.Вещественный тип запрещен.
  • 23. Function needs result type. В заголовке функции надо указывать тип ее результата.
  • 24. Identifier expected but <Что-то> found. В этом месте должно стоять имя. Например, пропущено имя функции после Function.
  • 25. Identifier redeclared <Имя>.<Имя> описано повторно, но в пределах блока имя можно описать лишь раз. Проверьте, не обозначена ли локальная переменная тем же именем, что и формальный параметр блока.
  • 26. Illegal character in input file <знак>. Запретный знак, например «русская» буква, либо вы оставили скобку }, убрав открывающую скобку {.
  • 27. Illegal type in Read/Readln (Write/Writeln) statement. Элемент запрещенного типа в списке ввода/вывода.
  • 28. Incompatible types <указание типов>. Несоответствие типов по присваиванию или типов операндов одной операции. Сообщение выдается и при неверном использовании структур. Например, z — запись, ошибочно записано присваивание z:= 0 (работать надо с полями записи).
  • 29. Invalid function result type. Недопустимый тип результата функции.
  • 30. Label already defined: <Метка>. <Метка> уже помечает другой оператор.
  • 31. Left side cannot be assigned to. He может быть такой левой части в присваивании. Примеры: попытка присвоить значение файловой переменной, присвоение значения формальному параметру-константе.
  • 32. Line too long. В строке программного текста больше 255 знаков.
  • 33. Low bound exceeds high bound. Нижняя граница превышает верхнюю.
  • 34. Missing operator or semicolon.Пропуск операции (например перед скобкой) или пропуск точки с запятой. При пропуске ‘;’ маркер ошибки стоит на очередном предложении (объявлении или операторе).
  • 35. Missing parameter type. He указан тип формального параметра-значения или параметра процедурного типа.
  • 36. Not enough actual parameters. He хватает фактических параметров.
  • 37. Need to specify at least one dimension … Нужно задавать в операторе SetLength хотя бы один размер динамического массива.
  • 38. Number of elements differs from declaration. Число элементов в структурной константе не соответствует ее описанию.
  • 39. Operator not applicable to this operand type. Операция не применима к операндам данного типа. Например: ‘А’ or ‘В’; ‘Text1’* ‘Text2’.
  • 40. Order of fields in record constant differs from declaration. Порядок полей в записи-константе не соответствует описанию записи.
  • 41. Ordinal type required. Требуется порядковый тип (например, в индексе).
  • 42. Out of memory. Компилятору не хватает памяти.
  • 43. Statement expected but <Что-то> found. В этом месте должен стоять оператор. Сообщение выдается во всех случаях, когда в тело блока или секцию инициализации ошибочно помещают описание (<Что-то>). Ошибочная форма обращения к процедуре Procedure <Имя> или к функции Function <Имя> также вызывает сообщение.
  • 44. Sets may have at most 256 elements. Множество (тип Set) не может содержать более 256 элементов.
  • 45. Slice standard function only allowed as open array argument. Функцию Slice можно использовать лишь как фактический параметр
  • 46. Statement not allowed in interface part. Предложения в секции интерфейса программного модуля недопустимы.
  • 47. Syntax error in real number. Синтаксическая ошибка в записи числа вещственного типа.
  • 48. There is no overload version of <Имя> that can be called with these arguments.Не предусмотрен перегружаемый блок <Имя>, который мог бы вызываться с таким аргументом. Пример: IntToStr(x), где х – выражение вещественного типа.
  • 49. Too many actual parameters. Фактических параметров больше, чем формальных.
  • 50. Type actual and formal var parameters must be identical. Тип фактического параметра должен быть идентичен типу формального параметра-переменной.
  • 51. Type of expression must be <Тип>. Выражение должно быть указанного типа. Например,после While и Until должно стоять логическое выражение.
  • 52. Undeclared identifier: <Имя>.Не описано <Имя>. Проверьте есть ли описание в нужном месте,нет ли описок в имени. Если указано имя компонента формы, проверьте,поместили ли компонент на данную форму.
  • 53. Unexpected end of file in comment started on line <N>. Неожиданный конец файла при незавершенном комментарии, начало комментария — в строке N.
  • 54. Unit name mismatch: <Имя>. Имя модуля ошибочно.
  • 55. Unsatisfied forward or external declaration <Имя>. Отсутствует описание блока, объявление которого было дано (заголовок в интерфейсе или в описании объектного типа, либо упреждающее описание).
  • 56. Unterminate string. He закрыта апострофом строка-константа типа string.

Рассмотрим также некоторые сообщения классов warning и hint.

  • Return value of function <Имя> might be undefined. В теле функции нет присваивания ее результата.
  • Variable <Имя> might not have been initialized. Указывает имя переменой, которой не задали значения.
  • For-Loop variable <Имя> may be undefined after loop. Попытка использования значения параметра For-цикла после завершения этого цикла.
  • Text after final ‘END.’ ignored by compiler. Текст, идущий за конечной строкой модуля, игнорируется компилятором.
  • Variable <Имя> is declared but never used in <Имя блока>. Обращает внимание на переменную <Имя>, описанную,но не нашедшую применения.
  • Value assigned to <Имя> never used. Хотя бы одно значение переменной <Имя> никак не использовано.

Несколько рекомендаций

Сосредотачивайтесь на первом сообщении компилятора. Исправление хотя бы одной ошибки и повторная компиляция может значительно уменьшить число сообщений об ошибках,поэтому не упорствуйте, стремясь понять сразу причину каждого сообщения.

Не удаляйте прежний вариант кода,пока не убедитесь,что ошибка устранена. Лучше на время закомментировать код,заключив его в скобки: { код }

Компилятор не анализирует, как будет выполняться программа, поэтому выход значения индекса из диапазона выявляет только если индекс задан константным выражением. Деление на ноль вообще пропускается, кроме оператора div, в случае если делитель — константное выражение.

  • Delphi как убрать сообщение об ошибке
  • Delphi webbrowser ошибка сценария
  • Delphi try except код ошибки
  • Delphi try except вывести ошибку
  • Delphi getlasterror текст ошибки