can't find unit MUIClass.base

AMIGASYSTEM · 7286

AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
on: July 21, 2023, 10:04:14 PM

Thanks and excuse my ignorance, tried FreePascal and I get an errorre "can't find unit MUIClass.base"
Where can I find MUIClass ?

I am not a developer, but I would like that on my AROS One x86 all work well !


mod: I have moved your issue out of the other thread because the topics did not relate to each other.

« Last Edit: July 22, 2023, 07:31:36 AM by magorium »



magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 634
    • Karma: +62/-0
  • Convicted non contributor
Reply #1 on: July 21, 2023, 10:17:52 PM
Where can I find MUIClass ?
The MuiClass source-code can be found here (https://github.com/alb42/MUIClass)

If you press the code button a popup window will appear with a link named "download.zip"

- Press the link and store the zip file (MUIClass-master.zip) to your disk.
- Extract the zip file (keep the directory structure)
- Copy all files from the directory MUIClass-master/src to the same directory as where you have stored the imagetest.pas program from MarcusF
- Now try to compile imagetest.pas again

That should solve your problem. If not the case then please report back.

Note that these instructions are only a solution to make it work as quick as possible

Under normal circumstances you would have to properly setup the MUIClass package so that the Free Pascal compiler can access it from every project no matter where your project/program is located (on disk). But doing so is a bit more complicated that is probably a bit out of scope for now. If you are really into things with this then feel free to poke me again on that subject and i can teach you how to do it properly.


AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #2 on: July 21, 2023, 10:58:15 PM
Thank you for your reply, the compilation was successful (i used Marcus' source code)

From the translation I didn't understand "press the code button a popup window", it might help if you attach a small screenshot.

If it is not very complicated, I would prefer to know the correct paths so that AROS One users, can use FPC without getting errors.
« Last Edit: July 22, 2023, 12:02:03 AM by AMIGASYSTEM »



magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 634
    • Karma: +62/-0
  • Convicted non contributor
Reply #3 on: July 21, 2023, 11:37:28 PM
Thank you for your reply, the compilation was successful (i used Marcus' source code), although an error message remained
:)
That is not an error message, that is a hint. A hint is like a piece of information to inform you about something. (*)

There are also messages that are named "warning" which is apiece of information that warns you that something in your code /might/ be causing issues or /can/ cause issues (for example if you forgot to initialize a variable).

Quote
From the translation I didn't understand "press the code button a popup window", it might help if you attach a small screenshot.
See picture. I should have added a comma somewhere in that sentence to make it more clear where to cut off the parts of the sentence that belong to each other.

Quote
If it is not very complicated, I would prefer to know the correct paths so that AROS One users, can use FPC without getting errors.
For experienced Free Pascal users it is not complicated but since you are talking about a distribution I would have to know some background information on how Free Pascal was installed and which exact version and then layout/explain some well defined instructions (which takes a fair amount of time).

fwiw: It is the same as for any other programming language in that you have to know your compiler and ij which directories it searches for certain files (gcc and include files is something similar).

(*) you've changed the picture attachment so can't comment on the exact hint that was displayed as I initially intended to do so  :)
« Last Edit: July 21, 2023, 11:41:36 PM by magorium »



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #4 on: July 22, 2023, 12:01:22 AM

That is not an error message, that is a hint. A hint is like a piece of information to inform you about something. (*)

Yes I had guessed the meaning of the message, in fact it did not find the file Test.png, as you can see new screenshot, I inserted in the path an image of mine and the message disappeared.

I also found out in which path to copy the "MUIClass" sources, Development:FPC/bin/i386-aros

On AROS One about the GCC, there are the right Assign, the GCC works perfectly from whatever path is run !



magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 634
    • Karma: +62/-0
  • Convicted non contributor
Reply #5 on: July 22, 2023, 12:01:32 AM
@AMIGAYSTEM:
Quote
I also found out in which path to copy the "MUIClass" sources, Development:FPC/bin/i386-aros
That is actually a bit wrong (even though it might perhaps work).

If you start the FP IDE can you show me the screenshots for both
- menu/help/about
- menu/options/directories


AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #6 on: July 22, 2023, 12:15:29 AM
- menu/help/about
- menu/options/directories

On AROS One for .pas sources I created Descriptor datatypes and Def_pas !


magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 634
    • Karma: +62/-0
  • Convicted non contributor
Reply #7 on: July 22, 2023, 01:00:21 AM
I am a bit puzzled, though I was finally able to locate where you downloaded 3.2.2 fixes from  :)

In the directories dialog you can see a path there marked as "FPC:addunits/$FPCTARGET/*"

I assume that ALB42 meant for that directory to be used for 3th party units, in which case:
- locate on your system the directory "FPC:addunits"
- if that directory does not exist then create a directory named "addunits" in FPC:
- copy the contents of the directory from MUIClass-master/src to FPC:addunits/i386-aros/MUIClass (if the directories addunits, i386-aros and/or MUIClass do not exist then create them
- for FP-IDE you should now have a working setup that detects the MUIClass package when compiling

(experienced users will notice that this isn't exactly the correct solution either but at least it is better as it acts more like as intended. It simply impossible to explain a custom setup because it depends on the end-user actually making use of it).

Quote
On AROS One for .pas sources I created Descriptor datatypes and Def_pas !
Note that FP-IDE uses its own separate internal compiler (thus not the fpc executable) so if you wish to also make the MUIClass package to work for the fpc command line compiler then you would have to modify the fpc.cfg file but before we can do that I need to see yours. Could you attach your fpc.cfg file to another message ?


« Last Edit: July 22, 2023, 01:29:03 AM by magorium »



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #8 on: July 22, 2023, 01:58:25 AM
That is actually a bit wrong (even though it might perhaps work).

In fact, it seems to work very well (I found out the path thanks to Sashimi)

Yes I know that the "FP" binary is located in the path FPC:bin/i386-aros/fp, and that is what I used for the def_PAS

Actually clicking on the Source Icon (see screenshot), FPC compiled the source without any problems, all the necessary files were found and no error message received, see screenshot


magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 634
    • Karma: +62/-0
  • Convicted non contributor
Reply #9 on: July 22, 2023, 02:18:21 AM
That is actually a bit wrong (even though it might perhaps work).
In fact, it seems to work very well (I found out the path thanks to Sashimi)
That does not change the fact that it is wrong  :)

That it works (for you) is purely coincidental. The compiler will eventually trip over it when adding other targets and/or packages.

But, please do not take my word for it as I'm merely an amateur when it comes to Free Pascal  :P

Quote
Yes I know that the "FP" binary is located in the path FPC:bin/i386-aros/fp, and that is what I used for the def_PAS
Ah, ok you had not mentioned that you use FP IDE as a tool. I expected that you would have used the fpc executable (commandline compiler) as a tool.

Though that works with FP-IDE, the fpc commandline compiler would still be unable to locate the MUIClass package properly.

You can check that by opening a new shell, changing the directory to where the example from MarcusF is located and attempt to compile it from the commandline with:
Code: [Select]
fpc "test.pas"
... that is, assuming that you have installed/setup the fpc comandline compiler for your distribution as well.
In case it does work with that command then that is also coincidental for the same reason that it works for you with FP-IDE


AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #10 on: July 22, 2023, 02:57:04 AM
Today is the lucky day of AROS One x86  :)

I don't know if I understood correctly, in Marcus's source I didn't identify particular paths, in any case even if I run the source from different paths, the compilation happens successfully !

Also tried to use the Binary (FPC.exe) from the Shell and the compilation happened without problems, see screenshot !

As you all know I am not a developer, in my opinion the Binary "FPC" is faster, in Def_PAS, but "FP" allows you to do other operations on the source q
« Last Edit: July 22, 2023, 04:04:30 AM by AMIGASYSTEM »



magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 634
    • Karma: +62/-0
  • Convicted non contributor
Reply #11 on: July 22, 2023, 04:51:59 AM
I don't know if I understood correctly, in Marcus's source I didn't identify particular paths, in any case even if I run the source from different paths, the compilation happens successfully !
Let's try an clear up a few things  :)

Using the name Marcus (at least to me) works confusing. ALB42's real name is Marcus and MarcusF's real name is also Marcus.

They are two different individual persons and should therefor not be mixed (that is why I explicitly try to use the name ALB42 instead of Marcus when referring to Marcus S instead of Marcus F).


The "path" I was talking about is set in the FP-IDE as shown in the screenshot you attached when I asked for it (for which I thank you very much).

So, it has nothing to do from which directory you invoke/start the fpc or fp executable but which directory fp and fpc uses to locate their (3th party installed) units. As that is defined by a set of rules for which you need to read the official Free Pascal manuals in order to understand how that is suppose to be set up correctly.

ALB42 apparently already did some pre-work for us in that regards and, as such we are more or less obligated to use it (unless someone choose to do it differently and use a custom setup as is allowed to be done by anyone as long as the set rules are followed).

MarcusF (thus not ALB42) already asked (in another thread) a similar question about MUIClass the day before you did and he understood the path to MUIClass needed to be added/adjusted for his personal FP-IDE setup, he just not understood why initially it did not work for him and so asked for help. He eventually managed to solve the issue and he knew how and where to do that.

Now that he knows, he is able to do the same for any other (3th-party) package as the process is similar and will always work while the solution you choose to use might seem to work initially but, on the long run is not maintainable and for sure will cause errors as that general bin directory is used to store compiler binary executables used by the compiler while any unit name stored in there with the same name has the chance to overwrite any of the executables that are stored in there simply by means of compilation (and that will cause errors for end-users and such errors that are very difficult to detect/recognize because no one in his/her right mind would store units in bin(ary) directory that you now have used).

And then I did not even mentioned the fact that units are suppose to be stored on a per platform base so compiled units should always reside in a subdirectory of the platform name (i386-aros, x86_64-aros, arm-aros etc) and which logic your chosen solution defies.

Quote
As you all know I am not a developer, in my opinion the Binary "FPC" is faster, in Def_PAS, but "FP" allows you to do other operations on the source q
Yeah it is a shame that it is not possible (by default workbench) to choose which action to perform for a known file-type (I know that magellan desktop replacement can do it). It is all in the eye of the beholder what would be the best cause of action so your solution to use fp as a tool to open the .pas file is as good as any (no complaints there  :) )
« Last Edit: July 22, 2023, 04:58:53 AM by magorium »



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #12 on: July 22, 2023, 08:23:27 AM
Perfect magorium, in fact in the "Bin" path it could overwrite some binaries.

The path "FPC:Addunits\i386-aros\MUIClass" worked perfectly, on the first run new files are always generated in that path.