Sign in Join

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

Mailing lists / lazarus / 2020-07

Why can Lazarus not find a file in the source dir?

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

I just copied over a project I have been working on in Windows using Lazarus 2.0.8/FPC 3.0.4.
The "copy" was done through Subversion (commit in Windows, update in Linux).

On Windows the project builds OK (but with incomplete code so it will not yet work).
On Linux I get this error:

SSRemoteServerLx.lpr(36,3) Fatal: Cannot find class_SSremoteServer
used by SSRemoteServerLx of the Project Inspector.

SSRemoteServerLx is the project name and the lpr file name.

And the file class_SSremoteServer.pas opens just fine in the code editor and it is located in the project source dir together with all the other project files...

Why does Lazarus on Linux complain like this?
Note:
I started the project on Linux, then checked it in to SVN and out to Windows, where I have spent a week on it. Now committed the changes and went back to Linux only to find this strange error...

Since the file IS available in the source dir and since the Lazarus code editor can find it I fail to understand why Lazarus complains when I try to test build the code.

Can someone please suggest where to look for a solution?

Can case be involved in the file names vs. uses clauses? I was under the assumption that Pascal/FPC/Lazarus are case-insensitive...

Bo Berglund Developer in Sweden

Reply by email

Mattias Gaertner
to Bo Berglund
[...] Can case be involved in the file names vs. uses clauses? I was under the assumption that Pascal/FPC/Lazarus are case-insensitive...

No, fpc searches on Linux mixed case, lower case, upper case.

Compile with -vt to find out what files fpc searches and finds.

Mattias

Reply by email

Bo Berglund
to Mattias Gaertner
Mattias Gaertner wrote 9 lines
On Sat, 18 Jul 2020 22:17:03 +0200 Bo Berglund via lazarus wrote: >[...] > Can case be involved in the file names vs. uses clauses? > I was under the assumption that Pascal/FPC/Lazarus are > case-insensitive... No, fpc searches on Linux mixed case, lower case, upper case.

Do you mean that fpc treats class_SSremoteServer and class_SSRemoteServer as different units?
Or do you mean it treats them as the same unit?

Compile with -vt to find out what files fpc searches and finds.

It turns out that the problem was a case error after all. The message was:

SSRemoteServerLx.lpr(36,3) Fatal: Cannot find class_SSremoteServer
used by SSRemoteServerLx of the Project Inspector.

And the actual file on disk was named class_SSRemoteServer.pas

After I changed he identifier in the uses clause from class_SSremoteServer
to
class_SSRemoteServer

then Lazarus moved on to the next such typo which I could fix in the same way...

So it looks like it is case sensitive on Linux...

Bo Berglund Developer in Sweden

Reply by email

Mattias Gaertner
to Bo Berglund
Show quoted text 6 lines
[...] >No, fpc searches on Linux mixed case, lower case, upper case. Do you mean that fpc treats class_SSremoteServer and class_SSRemoteServer as different units? Or do you mean it treats them as the same unit?

A bit of both. You cannot have both in the same program. But FPC does not search any case on Linux, so you have to either use lowercase filenames (like most Lazarus and FPC sources) or make sure that all uses sections use the correct spelling.

Show quoted text 20 lines
>Compile with -vt to find out what files fpc searches and finds. > It turns out that the problem was a case error after all. The message was: SSRemoteServerLx.lpr(36,3) Fatal: Cannot find class_SSremoteServer used by SSRemoteServerLx of the Project Inspector. And the actual file on disk was named class_SSRemoteServer.pas After I changed he identifier in the uses clause from class_SSremoteServer to class_SSRemoteServer then Lazarus moved on to the next such typo which I could fix in the same way... So it looks like it is case sensitive on Linux...

That's why pas2js uses any case on Linux. It would be nice if FPC can be told to do so as well.

Mattias

Reply by email