Recent

Author Topic: Illegal unit name  (Read 14927 times)

Guest

  • Guest
Illegal unit name
« on: June 21, 2006, 04:43:07 am »
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:
Quote
Zeos.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,41) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(700,9) Hint: Local variable "c" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(813,46) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1130,26) Hint: Variable "Buf" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1372,19) Hint: Type "TMbcsByteType" redefinition
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1374,25) Hint: Parameter "S" not used
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1374,36) Hint: Parameter "Index" not used
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1407,29) Hint: Local variable "c" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1588,20) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1710,34) Hint: Local variable "lbuf" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1924,41) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1931,82) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(1959,71) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2001,35) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2004,36) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2007,36) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2017,36) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2093,43) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2109,44) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2115,43) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2119,44) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2126,41) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2128,42) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2130,40) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2133,42) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2142,38) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2161,39) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2171,45) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2177,41) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2189,41) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2309,69) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2334,78) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2448,40) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2470,3) Hint: Local variable "e" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2482,69) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2525,50) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2530,25) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2531,27) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2532,56) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2534,55) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2536,31) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2662,15) Hint: Local variable "e" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2670,14) Hint: Local variable "b" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2691,38) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(2732,40) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3055,3) Hint: Local variable "b" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3071,3) Hint: Local variable "Signature" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3174,9) Hint: Local variable "b" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3250,3) Hint: Local variable "b" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3264,9) Hint: Local variable "b" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3298,5) Hint: Local variable "CompName" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3298,5) Hint: Local variable "CompClassName" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3298,5) Hint: Local variable "Dummy" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3298,5) Hint: Local variable "Flags" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3324,7) Hint: Local variable "Dummy" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3524,42) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3577,36) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3928,33) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3928,34) Hint: Local variable "a" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3929,34) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3945,19) Hint: Local variable "vt" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3960,7) Hint: Local variable "v8" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3965,7) Hint: Local variable "v16" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3970,7) Hint: Local variable "v32" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(3975,7) Hint: Local variable "v64" does not seem to be initialized
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(4033,48) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(4056,42) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(4063,38) Hint: Type size mismatch, possible loss of data / range check error
E:\lazarus916\components\zeosdbo_rework\src\component\LResources.pp(4067,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

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
RE: Illegal unit name
« Reply #1 on: June 21, 2006, 11:50:05 am »
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" ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Anonymous

  • Guest
RE: Illegal unit name
« Reply #2 on: June 21, 2006, 03:51:43 pm »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
RE: Illegal unit name
« Reply #3 on: June 23, 2006, 10:52:45 am »
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.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

ozznixon

  • Full Member
  • ***
  • Posts: 119
    • http://www.modernpascal.com/
Re: Illegal unit name
« Reply #4 on: March 16, 2018, 04:12:21 am »
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
---
Want to kick the tires to a Free Pascal like script engine? http://www.ModernPascal.com/

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Illegal unit name
« Reply #5 on: March 16, 2018, 08:22:39 am »
"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:
« Last Edit: March 16, 2018, 10:27:38 am by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018