Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-07

converted Delphi unit in a lazarus package

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

John Landmesser

Hi,

attached Delphi unit containes TFindFile and a register procedure.

I can add findfile1 to the uses clause of a project and then i can TFileFind.Create ...use it ... no probs.

But if i put findfile1.pas to a new or existing package i can compile the package but i cannot install it to lazarus IDE. Error -> findfile1.pas not found, what ever i do with the package settings!

Any idea what i'm missing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: findfile1.pas
Type: text/x-pascal
Size: 7967 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110708/271d17d2/attachment.bin>

Reply by email

Mattias Gaertner
to John Landmesser
Show quoted text 9 lines
Hi, attached Delphi unit containes TFindFile and a register procedure. I can add findfile1 to the uses clause of a project and then i can TFileFind.Create ...use it ... no probs. But if i put findfile1.pas to a new or existing package i can compile the package but i cannot install it to lazarus IDE.

Is the 'Use unit' enabled in the package editor for this unit? Can you compile the package?

Error -> findfile1.pas not found, what ever i do with the package settings! Any idea what i'm missing?

Mattias

Reply by email

John Landmesser
to Mattias Gaertner
Mattias Gaertner wrote 25 lines
On Fri, 08 Jul 2011 21:11:46 +0200 John Landmesser wrote: > Hi, > > attached Delphi unit containes TFindFile and a register procedure. > > I can add findfile1 to the uses clause of a project and then i can > TFileFind.Create ...use it ... no probs. > > But if i put findfile1.pas to a new or existing package i can compile > the package but i cannot install it to lazarus IDE. Is the 'Use unit' enabled in the package editor for this unit? Can you compile the package? > Error -> findfile1.pas not found, what ever i do with the package settings! > > Any idea what i'm missing? Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

"use unit" and "register unit" is checked in package settings and i can compile the package!

I have a german language Lazarus IDE so i don't know the english captions of these checkboxes

Reply by email

Mattias Gaertner
to John Landmesser
Show quoted text 10 lines
[...] >> I can add findfile1 to the uses clause of a project and then i can >> TFileFind.Create ...use it ... no probs. >> >> But if i put findfile1.pas to a new or existing package i can compile >> the package but i cannot install it to lazarus IDE. [...] "use unit" and "register unit" is checked in package settings and i can compile the package!

And then you click 'Install'. And what happens?

Mattias

Reply by email

John Landmesser
to Mattias Gaertner
Mattias Gaertner wrote 22 lines
On Fri, 08 Jul 2011 22:11:37 +0200 John Landmesser wrote: > [...] >>> I can add findfile1 to the uses clause of a project and then i can >>> TFileFind.Create ...use it ... no probs. >>> >>> But if i put findfile1.pas to a new or existing package i can compile >>> the package but i cannot install it to lazarus IDE. > [...] > > "use unit" and "register unit" is checked in package settings and i can > compile the package! And then you click 'Install'. And what happens? Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

i get this german error message:

Kann die Datei "findfile1.pas" nicht finden.
Falls sie zum Projekt geh?rt, pr?fen Sie den Suchpfad in der Startseite von Projekt->Compilereinstellungen ... unter Andere Unit-Dateien. Wenn die Datei zu einem Package geh?rt, m?ssen dessen Einstellungen gepr?ft werden. Falls die Datei zu Lazarus geh?rt, mu? sichergestellt sein, da? die IDE sauber kompiliert ist. Geh?rt die Datei zu FPC mu? die fpc.cfg ?berpr?ft werden. Bei Unklarheiten hilft der Button Test unter Projekt -> Compilereinstellungen ... -> Test

In Package settings, other units:
$(PkgOutDir);findfile

findfile is the directory if findfile1.pas

Reply by email

Mattias Gaertner
to John Landmesser
Show quoted text 38 lines
Am 08.07.2011 22:30, schrieb Mattias Gaertner: > On Fri, 08 Jul 2011 22:11:37 +0200 > John Landmesser wrote: > >> [...] >>>> I can add findfile1 to the uses clause of a project and then i can >>>> TFileFind.Create ...use it ... no probs. >>>> >>>> But if i put findfile1.pas to a new or existing package i can compile >>>> the package but i cannot install it to lazarus IDE. >> [...] >> >> "use unit" and "register unit" is checked in package settings and i can >> compile the package! > And then you click 'Install'. And what happens? > > Mattias > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus i get this german error message: Kann die Datei "findfile1.pas" nicht finden. Falls sie zum Projekt geh?rt, pr?fen Sie den Suchpfad in der Startseite von Projekt->Compilereinstellungen ... unter Andere Unit-Dateien. Wenn die Datei zu einem Package geh?rt, m?ssen dessen Einstellungen gepr?ft werden. Falls die Datei zu Lazarus geh?rt, mu? sichergestellt sein, da? die IDE sauber kompiliert ist. Geh?rt die Datei zu FPC mu? die fpc.cfg ?berpr?ft werden. Bei Unklarheiten hilft der Button Test unter Projekt -> Compilereinstellungen ... -> Test In Package settings, other units: $(PkgOutDir);findfile

The dependent packages/projects only need the $(PkgOutDir). Change the compiler paths of the package instead.

findfile is the directory if findfile1.pas

Mattias

Reply by email

John Landmesser
to Mattias Gaertner
Mattias Gaertner wrote 44 lines
On Fri, 08 Jul 2011 23:30:47 +0200 John Landmesser wrote: > Am 08.07.2011 22:30, schrieb Mattias Gaertner: >> On Fri, 08 Jul 2011 22:11:37 +0200 >> John Landmesser wrote: >> >>> [...] >>>>> I can add findfile1 to the uses clause of a project and then i can >>>>> TFileFind.Create ...use it ... no probs. >>>>> >>>>> But if i put findfile1.pas to a new or existing package i can compile >>>>> the package but i cannot install it to lazarus IDE. >>> [...] >>> >>> "use unit" and "register unit" is checked in package settings and i can >>> compile the package! >> And then you click 'Install'. And what happens? >> >> Mattias >> >> -- >> _______________________________________________ >> Lazarus mailing list >> >> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > > i get this german error message: > > Kann die Datei "findfile1.pas" nicht finden. > Falls sie zum Projekt geh?rt, pr?fen Sie den Suchpfad in der Startseite von > Projekt->Compilereinstellungen ... unter Andere Unit-Dateien. Wenn die > Datei zu einem Package geh?rt, m?ssen dessen Einstellungen gepr?ft > werden. Falls die Datei zu Lazarus geh?rt, mu? sichergestellt sein, da? > die IDE sauber kompiliert ist. Geh?rt die Datei zu FPC mu? die fpc.cfg > ?berpr?ft werden. Bei Unklarheiten hilft der Button Test unter Projekt > -> Compilereinstellungen ... -> Test > > In Package settings, other units: > $(PkgOutDir);findfile The dependent packages/projects only need the $(PkgOutDir). Change the compiler paths of the package instead.

New in Package settings, other units:
$(PkgOutDir)

but no success, same error message

I'll try to write a clean new lazarus unit findfile1 an try again.

p.s.
The button Test in package settings gives the following hint: ANMERKUNG: using config file /etc/fpc.cfg
WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/httpd.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd13/httpd.ppu WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd22/apriconv.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/apriconv.ppu WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd22/apr.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/apr.ppu WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd22/aprutil.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/aprutil.ppu WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd22/httpd.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/httpd.ppu WARNUNG: Das Ausgabeverzeichnis von mycomps 0.0 ist im Unit-Suchpfad von mycomps 0.0 aufgef?hrt.Das Ausgabeverzeichnis sollte ein eigenes Verzeichnis sein und keine Quelldateien enthalten.

That's my first package in lazarus so i have to think about last WARNUNG

But even if i insert findfile1 to an existing, working package ( not from me! ) i get this error message, strange !

Uh, its saturday and i have to get something to eat for next week :-))

Do we have another object TFileFind in a standard lazarus IDE ?

Reply by email

Mattias Gaertner
to John Landmesser
Show quoted text 19 lines
[...] >> Kann die Datei "findfile1.pas" nicht finden. >> Falls sie zum Projekt geh?rt, pr?fen Sie den Suchpfad in der Startseite von >> Projekt->Compilereinstellungen ... unter Andere Unit-Dateien. Wenn die >> Datei zu einem Package geh?rt, m?ssen dessen Einstellungen gepr?ft >> werden. Falls die Datei zu Lazarus geh?rt, mu? sichergestellt sein, da? >> die IDE sauber kompiliert ist. Geh?rt die Datei zu FPC mu? die fpc.cfg >> ?berpr?ft werden. Bei Unklarheiten hilft der Button Test unter Projekt >> -> Compilereinstellungen ... -> Test >> >> In Package settings, other units: >> $(PkgOutDir);findfile > The dependent packages/projects only need the $(PkgOutDir). Change the > compiler paths of the package instead. > > New in Package settings, other units: $(PkgOutDir)
Set the 'Package Options / Usage' to default values:
Package Options / Usage / Unit := $(PkgOutDir)
Package Options / Usage / all other := leave empty

Add the 'findfile' directory to
Compiler options / Paths / Other Unit Files

Remove the 'findfile' directory from any other search path you have altered.

When you add an unit to the package the IDE normally asks if it should do this for you.

Show quoted text 12 lines
but no success, same error message I'll try to write a clean new lazarus unit findfile1 an try again. p.s. The button Test in package settings gives the following hint: ANMERKUNG: using config file /etc/fpc.cfg WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/httpd.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd13/httpd.ppu WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd22/apriconv.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/apriconv.ppu WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd22/apr.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/apr.ppu WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd22/aprutil.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/aprutil.ppu WARNUNG: ppu ist zweimal vorhanden: /usr/lib/fpc/2.4.2/units/i386-linux/httpd22/httpd.ppu, /usr/lib/fpc/2.4.2/units/i386-linux/httpd20/httpd.ppu

The aboves are only warnings. If you don't use these units you can ignore them.
BTW, I recommend to use 2.4.4 with Lazarus svn trunk.

WARNUNG: Das Ausgabeverzeichnis von mycomps 0.0 ist im Unit-Suchpfad von mycomps 0.0 aufgef?hrt.Das Ausgabeverzeichnis sollte ein eigenes Verzeichnis sein und keine Quelldateien enthalten. That's my first package in lazarus so i have to think about last WARNUNG

Yes.
Maybe this helps:
A normal package has some sources and creates ppu/o files that are put into the output directory. The project is compiled separately and only needs the ppu files.

But even if i insert findfile1 to an existing, working package ( not from me! ) i get this error message, strange !

Use Run / Clean up build files.

Uh, its saturday and i have to get something to eat for next week :-)) Do we have another object TFileFind in a standard lazarus IDE ?

You can find out with Search / Find in Files or View / Codebrowser.

Mattias

Reply by email

John Landmesser
to Mattias Gaertner

i found one problem in my unit findfile1.pas:

inserted the compiler directive

{$mode objfpc}{$H+}

and now the package can be compiled to lazarus, and TFilefind appears in my component palette.

But there is the next problem.
If i add FileUtil to the uses clause of findfile1 -> error -> FileUtil not found.

But for me it's ok to have the working TFindFile in my component palette !

What for? It searches multiple file filters at once: *.xls;*.csv

Do you know a fpc function that can do that?

thanks for your help !!

John

Reply by email

Bart
to John Landmesser

I have a EnumDirs unit that does just that (it also allows for exclude filters).

Bart

John Landmesser wrote 39 lines
i found one problem in my unit findfile1.pas: inserted the compiler directive {$mode objfpc}{$H+} and now the package can be compiled to lazarus, and TFilefind appears in my component palette. But there is the next problem. If i add FileUtil to the uses clause of findfile1 -> error -> FileUtil not found. But for me it's ok to have the working TFindFile in my component palette ! What for? It searches multiple file filters at once: *.xls;*.csv Do you know a fpc function that can do that? thanks for your help !! John -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email