Recent

Author Topic: Can't find unit error  (Read 5332 times)

Guest

  • Guest
Can't find unit error
« on: September 26, 2005, 12:07:10 pm »
The uses clause in my project is as following:
uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls,  Buttons, EQFormat in 'C:\pp\MyDataFormat.pas';
But I get an error 'Can't find unit MyDataFormat',here the unit file 'C:\pp\MyDataFormat.pas' is my code file,I wrote it to declare some data type.How the compiler knows where to find the units?I have set the unit path in the menu item 'Project ->compiler options->other sources',and the resulting set is
C:\pp\;$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\;
$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\;
$(LazarusDir)\components\synedit\;$(LazarusDir)\components\codetools\
But I still get the error.
Maybe this is a very,very beginer's question,but even I have googled on the internet I did not find any solution to solve it.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: Can't find unit error
« Reply #1 on: September 26, 2005, 12:13:13 pm »
Quote from: "Guest"
EQFormat in 'C:\pp\MyDataFormat.pas';


This is not allowed. Filenames and unitnames need to be the same.

so either name your unit EQFormat and the file EQFormat.pas
or name your unit MyDataFormat and the file MyDataFormat.pas

I know the in 'filename' is a delphi way to tell the ide where a file is located. I don't know if FPC uses this.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018