Jump to content
JGMS

FMX package units not found after FmxLinux installation

Recommended Posts

Quote

I have installed FmxLinux, got the PaServer up and running (D12 in Windows11, WSL2, Ubuntu22.04) and added and selected the LinuxPlatform in a new, multi-device, blank application: a form with a single button.

In the project file (shown below) the problem is already hinted, showing:  'E2212: Package unit "FMX.Forms" cannot appear in contains or uses clauses'.

FireMonkey applications for Windows run fine, so FMX package units cannot be missing.

What can be wrong?

 


program Project1;

uses
  System.StartUpCopy,
  FMX.Forms, <<== design-time error hint 'E2212: Package unit "FMX.Forms" cannot appear in contains or uses clauses'
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

var
  Form1: TForm1;

implementation

{$R *.fmx}

end.

 

 

Share this post


Link to post

Did you install FMXLinux via getit ?

Share this post


Link to post
Posted (edited)

Jus did a Form with a button and it works against Ubuntu, CentOS7, Rocky8
But I have the FMX.Forms in the main unit uses section, not in the project file.

Screenshot 2024-04-08 at 09.29.46.png

 

For your info, I just installed FMXLinux from GetIt and didn't configure anything else.

I think a requirement is that you need a Linux connection and SDK before installing but that's about it.
It didn't require any path definitions, etc...

 

Screenshot 2024-04-08 at 09.29.12.png

Edited by sjordi

Share this post


Link to post
Posted (edited)

Thank you @Serge_G and @sjordi for taking time to answer.
 

Initially I had FMX installed by using the installer V1.77 that comes with the updates that I got from the original developer (I bought a lifetime version a couple of years ago). It always ran perfect, except for this time.

Because of the error I subsequently installed it via GetIT (V1.76), but this yielded the same error.
I quess things will get better after a fresh installation of the latest update to Delphi version 12.1.

I will keep you informed.

 


I

Edited by JGMS

Share this post


Link to post

The install should define all the library and search paths for you if you install via GetIt.
And the FMX.Form has nothing to do in the dpr or dproj file, but in the unit that uses it (the main form).

Good luck

Share this post


Link to post

Just from the top of my head, you absolutely need a Linux profile defined in your editor, either Ubuntu, Rocky or CentOS.
Do you have one that is not only defined, but on which you installed PAServer, connected to it, and then, mandatory, added a Linux SDK?
Then FMXLinux...

Share this post


Link to post

I have a Linux deployment profile (Ubuntu) configured. Connection to it succeeds.

 

If I make a new project, say MasterDetailApplication, building succeeds for all platforms but Linux. The project file uses FMX.Forms.  I see errors:

 

Package unit 'FMX.Forms' cannot appear in contains or uses clauses...

Undeclared identifier 'Application'...

I'm using the FMXLinux installed by the Delphi 12.1 web installer. I have not tried installing FMXLinux from GetIt.

Share this post


Link to post

Just checked on my Athens 12.2 and Ubuntu.

Created an empty MasterDetailApplication, works like a charm.

Here is a screenshot.
Where do you declare FMX.Forms? It's in the main form class and as well in the .dpr file. Did you tinker with them or not?

Did you change any of your default IDE paths?

Here are mine (My Documents is on the Mac, hence the y:\Documents but it should not change anything for you) for default ones and overrides.

I also include my empty project for you to check.

 

Default.png

Overrides.png

Ubuntu.png

UbuntuMasterDetails.zip

Share this post


Link to post

I haven't changed anything about the stock MasterDetail app. FMX.Forms is declared in both the project file and the main unit. I've done no tinkering.

I have added paths but not changed any of the existing ones, I believe.

Your empty project behaves exactly as mine does, giving the same errors.

I will check my paths against yours...

Thanks for taking your time to help me.

Share this post


Link to post

Did you install Delphi in a clean VM or over an existing previous version?
I try to always have an empty Windows 10 or 11 VM from which I install RadStudio clean. That way, I'm always sure I don't face trailing registry keys, etc... Even if they're supposed to be fully compartmented to the specific product, sometimes, Windows does funny things.

 

Good luck.

Steve

Share this post


Link to post

The story...

 

I've already reinstalled Delphi 12.1 since installing it originally. That was because of a Linux problem. Reinstalling 'fixed' the problem. I just uninstalled and reinstalled Delphi. No special cleaning operations. But now another Linux problem has cropped up.

 

I see over and over people running Delphi on a VM. I tried that a few years back on a Mac. I forget the details but it had 16 GB RAM and an open source VM system (Parallels? or maybe free VMWare?). Delphi's jerky performance on the VM drove me nuts. I finally decided to go back to giving Delphi its own machine.

 

I'm don't want to take the time right now to go back to a VM, even though it sounds like a good idea. Instead I'm going to spend my weekend going thru my Linux configuration with a fine toothed comb, trying to find what I'm doing wrong, and fix it.

 

So you just opened my eyes. I've got an ongoing, persistent Linux problem. I'd 'forgotten' about my other Linux problem until I talked to you.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×