Illegal unit name lazarus / 16-Databases ---------------------------------------------------------------------- Guest · 2006-06-21 02:43 My environment:win2k+lazarus0.9.16,when I install the zeos_rework package,the zcore,zparsesql,zplain and zdbc package were compiled ok.Then I begin to compile the zcomponent package,and the message window says: QuoteZeos.inc(42,2) Warning: Unsupported switch "$O" Zeos.inc(42,2) Warning: Unsupported switch "$O" E:\lazarus916\components\zeosdbo_rework\src\component\FPCAdds.pas(59,4 1) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(70 0,9) Hint: Local variable "c" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(81 3,46) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(11 30,26) Hint: Variable "Buf" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(13 72,19) Hint: Type "TMbcsByteType" redefinition E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(13 74,25) Hint: Parameter "S" not used E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(13 74,36) Hint: Parameter "Index" not used E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(14 07,29) Hint: Local variable "c" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(15 88,20) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(17 10,34) Hint: Local variable "lbuf" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(19 24,41) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(19 31,82) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(19 59,71) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(20 01,35) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(20 04,36) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(20 07,36) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(20 17,36) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(20 93,43) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 09,44) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 15,43) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 19,44) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 26,41) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 28,42) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 30,40) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 33,42) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 42,38) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 61,39) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 71,45) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 77,41) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(21 89,41) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(23 09,69) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(23 34,78) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(24 48,40) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(24 70,3) Hint: Local variable "e" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(24 82,69) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(25 25,50) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(25 30,25) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(25 31,27) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(25 32,56) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(25 34,55) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(25 36,31) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(26 62,15) Hint: Local variable "e" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(26 70,14) Hint: Local variable "b" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(26 91,38) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(27 32,40) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(30 55,3) Hint: Local variable "b" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(30 71,3) Hint: Local variable "Signature" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(31 74,9) Hint: Local variable "b" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(32 50,3) Hint: Local variable "b" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(32 64,9) Hint: Local variable "b" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(32 98,5) Hint: Local variable "CompName" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(32 98,5) Hint: Local variable "CompClassName" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(32 98,5) Hint: Local variable "Dummy" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(32 98,5) Hint: Local variable "Flags" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(33 24,7) Hint: Local variable "Dummy" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(35 24,42) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(35 77,36) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(39 28,33) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(39 28,34) Hint: Local variable "a" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(39 29,34) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(39 45,19) Hint: Local variable "vt" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(39 60,7) Hint: Local variable "v8" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(39 65,7) Hint: Local variable "v16" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(39 70,7) Hint: Local variable "v32" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(39 75,7) Hint: Local variable "v64" does not seem to be initialized E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(40 33,48) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(40 56,42) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(40 63,38) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(40 67,52) Hint: Type size mismatch, possible loss of data / range check error E:\lazarus916\lcl\Calendar.pp(29,6) Error: Illegal unit name: Calendar E:\lazarus916\lcl\Calendar.pp(134,1) Fatal: There were 1 errors compiling module, stopping Please look at the line: 'E:\lazarus916\lcl\Calendar.pp(29,6) Error: Illegal unit name: Calendar'. I searched for the unit 'calendar' in the hard disk,and there are two: one is in the path: E:\lazarus916\components\zeosdbo_rework\packages\lazarus\build and the other is in the path: E:\lazarus916\lcl\units\i386-win32 is that the problem? ---------------------------------------------------------------------- Marc · 2006-06-21 09:50 the same unit name should not give a illegal unitname error, however I can't see why the compiler gives this error. THe name looks ok. the file itself has a line "unit Calendar" ? ---------------------------------------------------------------------- Anonymous · 2006-06-21 13:51 I suppose that the problem would be that there is already a 'TCalendar' component in the misc pallette,so when I try to install the calendar component onto this pallette,the compiler gives 'illegal unit name' error.and I remember someone had said that one should not compile the zcomponent package,just install it after the compilation of the zcore,zparsesql,zplain and zdbc package.How ever, there are still problems:when I install the zcomponent package without compiling it,there comes much compiler error like 'fatal:can't find unit xxx',thouth I had set the unit path in the menu:project->compiler options->other unit files,and the menu:open recent packages->zcomponent.lpk->compiler options->other unit files,sometimes this is ok,but sometimes it does not work.For example: when I see the 'fatal:can't find unit xxx',I check that it is really in the unit path(such as 'e:\lazarus\lcl\xxx.pp'),but the compiler still complains 'can't find unit',and I was confused,it is very strange. ---------------------------------------------------------------------- Marc · 2006-06-23 08:52 You may have units with the same name. The compiler will use the first found. Besides the compiler doesn't know anything what is inside the palette. AFAIK you only get this message if the filename and the unit name differs. Is there a difference in casing ? All lower/uppercase filenames and a different unit name casing is OK, but IIRC having a difference in casing for unitname and filename is not ok. ---------------------------------------------------------------------- Ozz_Nixon · 2018-03-16 03:12 The solution is to compile adding -vt and -vb, so you can see what file(s) the compiler tried to find. Many times it is a few files back. I got the same issue in the past and again tonight, added -vt and -vb (found in my knowledge base) and was able to find the unit it could not find, even though it was reporting a different unit as having a bad unit name. (error message sucks). But, this will help you see what FPC is doing and get around this bogus "Illegal unit name" error. Ozz ---------------------------------------------------------------------- Thaddy · 2018-03-16 07:22 "Illegal unit name" can only be caused 1. the filename does not match the unit name, case insensitive, in the source or 2. illegal characters are used in the source name. This is only for units: programs can have differing names or even no sourcecode program name at all. e.g. here the filename is test, but the sourcename is Testme: