same name unit file in diffrent directory will can not work! lazarus / 6-IDE-CodeTools ---------------------------------------------------------------------- netwan · 2007-04-27 17:50 there is a sub project file in: d:\develop\tank\mapedit\mapedit.lpr Code: [Select]program mapedit; {$mode objfpc}{$H+} uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}   Interfaces, // this includes the LCL widgetset   Forms,   main in 'main.pas' {MainForm},   util in '..\util.pas',   mapunit in '..\mapunit.pas',   about in '..\about.pas' {AboutBox},   tileunit in '..\tileunit.pas',   sprite in '..\sprite.pas',   xUtils, xFiles; begin   Application.Initialize;   Application.CreateForm(TMainForm, MainForm);   Application.Run; end. also have a main project in d:\develop\tank\, if the directory exist same name file "main.pas".i found the sub project can not compiler alway,from lazarus ide's output window,i found the infomation, just fpc compiling d:\develop\tank\main.pas. ---------------------------------------------------------------------- CCRDude · 2007-04-28 19:25 Well yes, unit names have to be unique, that's not a bug, that's a definition And since you use the upper directory (pointing to ..\), that directory is part of the search path. You should feel lucky that you're using Lazarus and not Delphi, using the Delphi IDE this has lead to crashes or at least quite annoying IDE usage errors (including ghost debug points and other seemingly irrational stuff) over the past 4 or 5 versions. think about using proper unit names and you won't have any more problems (e.g. FormMapUnitMain, FormAboutBox, FormTankMain, ...).