Hi people,
I think I must be missing something obvious here as somebody must have had this problem before.
When I try and compile a very simple MUI test program, using IMUIMasterIFace and all that, it compiles and runs.
When I insert __USE_INLINE__, and remove all the interface bits, I get an error on the simple object macros.
In other words (__USE_INLINE__ not defined):
IMUIMaster->PopaslObject, End;
works.
But this (when __USE_INLINE__ is defined):
PopaslObject, End;
does not work. Instead I get:
error: unterminated argument list invoking macro "MUI_NewObject" main.c: In Function 'main': main.c:17: error: 'MUI_NewObject' undeclared (first use in this function) main.c:17: error: expected ';' at end of input main.c:17: error: expected declaration or statement at end of input
I'm sure it's something silly I've missed but I can't find a solution. Can someone point me to the relevant FAQ please? :)
Thanks!
@Spiranto
Dunno about that case exactly, but when i use __USE_INLINE__, all i should do its only open muimaster.library and IFACE anyway (but all mui functions of course used without iface bits). It can be something with includes like you include only libraries/muimaster.h , or only proto/muimaster or both
Thanks kas1e. That's what I thought, too, but it changes the macros for the simple object creation and gets very confused. I think it's because MUI_NewObject is #defined as a macro when you use __USE_INLINE__ and then when you do a simple object creation like "PopaslObject" then it expands it to MUI_NewObject, and then expands that to something else.
I'm including
and
as normal (tried including in different order - no change)
This problem is making it incredibly difficult to port an app which is multi-(Amiga-)platform and uses MUI!
@Spiranto
__USE_INLINE__ of course works with mui apps (that how i port odyssey, mui mplayer, lunapaint, zunefig and all other stuff) , just there can be something wrong somewhere else. Can you please upload ready-to-compile simple test case, so i can have a go with it, and if there is indeed bug in SDK we can report it to be fixed.
Thanks kas1e,
This is the code that doesn't work:
Removing the __USE_INLINE__ and re-enabling the IExec-> etc. makes it work. I've tried PopaslObject with and without the interface.
Thanks!
For me, no problem with MUI and _USE_INLINE__.
Take a look at this very simple and compilable sample. Maybe that you will find where you failed.
http://zzd10h.amiga-ng.org/Divers/MUI/TestMUI_Spirantho.lha
Bye
Thanks for that, but it's the same...
This is with a clean installation of the SDK, by the way.
Very confused now.
Ah, ok, me I still use the previous MUI 3.9 SDK.
I have the same error than you when I use the new MUI 4 SDK.
Except if I add
#define MUI_NewObject IMUIMaster->MUI_NewObject
to my test.c.
I know it's bad and don't resolve your problem.
I will keep my MUI3.9 SDK...until you find a way to solve your SDK ;)
@Spirantho
Maybe in some fresh mui4-sdk updates something was broken (as i use some previous versions of SDK for mui4 and it was ok, but also fail on new one as for you). I already send report to Thore, so imho we need just wait a bit and all will be fixed.
Do we know if this is being looked at at the moment? If it's being fixed then I'll hold off on my porting, but if it's not I'll have to go back to the MUI 3 SDK, which I'd rather not do if I can help it...
Thanks again for your help!
Just replace in SDK:MUI/C/include/inline4/muimaster.h
with
#define MUI_NewObject IMUIMaster->MUI_NewObject
That's how YAM is doing it.
@Spirantho
Yes, it was fixed (today) and will avail in next update (will put more details tomorrow, but i assume its something like gazelle says).
@Spirantho
Yep, checked the fix, and its right as Gazelle says 1:1