![]() |
![]() |
#1 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 433
|
Need help compiling my first MUI app
Hi all
Due to the wishes of the Amiga community, I have started the process of rewriting my AmigaGPT app from ReAction to MUI but I can't get it to successfully compile when adding some basic MUI code. It gives me a linker error saying the MUI library has an undefined reference to MUIMasterBase. I define this in the file that I am using the MUI library in.
I am compiling this with my Dockerised Amiga dev environment based on Bebbo's amiga-gcc toolchain. So all I have to do to compile it is just run the "build_os3.sh" script. All this work is living in a branch called ""mui" on my repo here https://github.com/sacredbanana/AmigaGPT/tree/mui The relevant files with mui changes are Makefile and src/gui.c If you want to build the project with my exact dev environment just install Docker and then run the "build_os3.sh" script I've been trying all sorts of things to get that linking error fixed but after several hours I'm starting to get disheartened. I'm guessing there must be something wrong in the Makefile. Thank you so much <3 |
![]() |
![]() |
#2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,095
|
Declare a global variable MUIMasterBase (of type Library*)? And eventually initialize it via OpenLibrary()...
|
![]() |
![]() |
#3 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 433
|
|
![]() |
![]() |
#4 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,095
|
Hmmm, ok. Thinking...
1. Did you dump the symbols in libmui.a (on UX I use nm, ar might be helpful too but less user friendly output iirc, not sure what you have available on amiga) and mui.o and check that they match (this is pure c, no c++ obfuscation, but maybe naming/calling convention or something. no underscores but, just in case...). 2. Once upon a time, back in the '90, I was working on a project that was ported to 30+ platforms, and some of the c compilers were stupid, very sensitive to lib/obj order. Maybe have that declaration in a separate .c/.o file and when linking put it before all the libs (-l's). Last edited by a/b; 30 June 2024 at 17:19. Reason: added ar |
![]() |
![]() |
#5 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,574
|
Where did you get that libmui.a from? Was it part of the gcc installation or is it from a different source (Aminet)?
MUIMasterBasewithout leading underscore seems strange. Looks like ELF-ABI, but last time I checked Bebbo's linker libraries used hunk-format objects, although confusingly they have an .a suffix (for ar) instead of .lib. So I'm not sure if ar or nm would help. You can also check if you can get rid of libmui completely and use inlines to call the library functions (including <proto/muimaster.h>might already do that). |
![]() |
![]() |
#6 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 433
|
I got the latest from 2021 here https://github.com/amiga-mui/muidev/...I-5.0-20210831
|
![]() |
![]() |
#7 | |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 433
|
Quote:
|
|
![]() |
![]() |
#8 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,574
|
Quote:
MUIMasterBase. |
|
![]() |
![]() |
#9 |
Coder/webmaster/gamer
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,711
|
I don't understand why you don't just use the official Amiga GUI and avoid all this?
|
![]() |
![]() |
#10 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,010
|
Maybe because ReAction hasn't been the official GUI toolkit that long and feels quite alien for many, and MUI has been the de facto toolkit for ages. And older solutions are more limited...
|
![]() |
![]() |
#11 |
Coder/webmaster/gamer
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,711
|
A quarter of a century is not long enough!?
|
![]() |
![]() |
#12 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,010
|
Well, maybe I put it in a bit wrong way, but if we look at versions and amount of use instead of time. It was introduced in H&P's OS 3.5/9, which were released at the very late days when Amiga was still somehow popular, and they were a bit controversial updates and weren't adapted by all users, because they felt more like 3rd party collections than real official OS updates. In practise most programs were still made to run on OS 3.1 with other toolkits, and actual use of ReAction has been very minimal, not even all programs in 3.5/9 were converted to use it. So it's been difficult to take it seriously as the official path until very recently. Hyperion's recent OS releases make it feel more like an official solution, and might make it somehow more popular, but still many programmers want to use toolkits that have been more widely used for longer time and don't require these exact OS versions (or ripping components of them).
|
![]() |
![]() |
#13 |
Registered User
Join Date: Apr 2016
Location: Perth, Australia
Posts: 433
|
I figured out the issue!
I removed the gcc compiler flag "-fwhole-program". Now everything links fine ![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running an MUI app on its own screen. | Hercules | support.Apps | 4 | 06 May 2021 21:23 |
Horizontal Group Has Content Partially Hidden in MUI v4, Not MUI v3.8a | tygre | support.Apps | 6 | 29 February 2016 03:27 |
Building dev versions on OS X -- creating Launcher.app & how to link to FSUAE.app | jrodman | support.FS-UAE | 6 | 07 December 2013 20:24 |
Compiling Dopus5. | Thorham | Coders. C/C++ | 0 | 29 September 2013 04:40 |
Compiling 1.3.4 | rotacak | support.WinUAE | 70 | 22 January 2007 08:13 |
|
|