I've made several tests: - tried to downgrade from SDL2 2.32.10 to 2.0.20 with no success (the working SDL2 version that I had was 2.0.14) - tried to recompile SDL2 2.32.10 on my native environment but I'm currently stuck to find GLES2 SDK - tried either GCC 8.4, 11.2 and 11.5 with any success - tried to remove stdc++ as you suggested but its required by SDL2_mixer:
7.Work:ETTU1/src> make -f Makefile.aos4
gcc -o Escape_d chunkyblitting.o enigmi.o escape.o findpath.o frasi.o freq.o game.o gels.o generic_video.o gfx.o gui.o header.o oggetti.o os_gui.o os_init.o os_locale.o os_video.o persone.o preferenze.o sound.o stanze.o astar.o astar_heap.o `pkg-config --libs SDL2_mixer` `pkg-config --libs sdl2` -lmodplug -lvorbis -lvorbisfile -logg -lauto -athread=native -lpthread
ld: warning: libstdc++.so, needed by /SDK/local/newlib/lib/libSDL2_mixer.so, not found (try using -rpath or -rpath-link)
/SDK/local/newlib/lib/libmodplug.so: undefined reference to `operator new(unsigned int)'
/SDK/local/newlib/lib/libSDL2.so: undefined reference to `__cxa_finalize'
/SDK/local/newlib/lib/libmodplug.so: undefined reference to `operator delete[](void*)'
/SDK/local/newlib/lib/libmodplug.so: undefined reference to `operator new[](unsigned int)'
/SDK/local/newlib/lib/libmodplug.so: undefined reference to `operator delete(void*, unsigned int)'
make: *** [Escape_d] Error 1
7.Work:ETTU1/src>
- tried to remove pkg_config with always undefined reference to cxi_finalize.
But, while I had the complete linker line, I tried to remove "-use-dynld" and it worked.
Unfortunately the executable obviously increased its size from 700 kB to 10 MB! This is not acceptable to me. I believe there is something different from the native environment that I use and the cross compile environment that everyone is using (If I have intended correctly). So I will try that way too even if I believe AmigaOS application should be compilable also on itself.
I will let you know if I was able to cross compile with dynamic link
EDIT: I've found the original version of the SDL2 that I used
Edited by Kirirur on 2026/6/8 17:22:10 Reason: Found old SDL revision
Regarding __cxa_finalize, you need the SDK updates from 4.1 FE Update 3. If the OS4 SDK is already installed when updating to 4.1 FE Update 3, then it gets automatically updated, otherwise you need to do it manually.
Extract AmigaOS4.1FinalEditionUpdate3-53.34.lha Copy contents of Content/SDK/ to SDK: (you might want to be selective about which files get overwritten)
If you use libopenssl, you'll probably want to rename SDK:include/include_h/openssl since those are for AmiSSL.
When I originally setup my AOS4 environment I used version 53.30 of the SDK (it was the one available at the moment) and when later I found the AOS 4 Update 3 I was not aware of the SDK 54.16, so when I upgraded my environment the update didn't touch my SDK files.
I have just tried to "re-execute" the "AmigaOS Final Edition Update 3" and now it detected the SDK 54.16 and proposed its upgrade.
I was able to correctly build my application at last!
I have noticed another issue however: the recent packages (at least SDL2_mixer and its stuff) does not copy updated .so in SOBJS: folder so I had to do that manually.
EDIT: I've just forgot to write a part: I indeed managed to recompile also the application using cross compiler (I have used walkero/amigagccondocker) but I noticed that the final size of the application was 9.5 MB more or less like the native version obtained removing the --use-dynld contrary to what @Capehill wrote.
Hello @Capehill are you referring to the dimension of the executable?
However I'm currently able to compile natively after I've updated my SDK 54.16 with the upgrade that comes with Amiga OS 4.1 FE Update 3 also using dynamic load (the exe is approx 1.2 MB).
I had to manually copy the .so required in the SOBJS: folder, only SDL2 distribution installs them correctly.
@Capehill Playing with sdl lately, and want to ask : is there reason why with iconify you go with custom AppIcon + HideWindow/ShowWindow instead of using for example window.class WM_ICONIFY/WM_OPEN and then refreshing the Window* / rebinding GL after restore ? For simplicity ? Or there another reasons for ?
@Capehill Is SDL2 can't have SDL_SetWindowGammaRamp ? As far as i see it not supported currently , but what was the reason behind if it still not ? Because of graphics.library didn't provide us with this functionality ? But then, this one can be done at least when ogles2 is used in hardware, right ? And maybe some software fallback.. Or there other reasons why this isn't implemented ?
@Capehill Yes, i thinking about fragment shader, but then, you had to apply it for every frame => loose fps. What i am about is casual "gamma" settings in games, which mean brightness probably in general.. But having that for each frame is killing for sure for fps.
@kishigo Current SDL2 you use didn't support mesa, but support only ogles2.library (so gl4es , warp3dnova, etc). To use mesa with SDL2 you need SDL2 which have support for it. I do not know how we should handle it in official SDL2 , this is up to Capehill, but in meantime you can use my SDL2_mesa.a (which you put to your SDK to the place where your current libSDL.a) placed then you use instead of -lSDL2 as -lSDL2_mesa. This version based on latest SDL2 from capehill, just instead of ogles2 mesa is used. There is: https://kas1e.mikendezign.com/aos4/mesa/libSDL2_mesa_2_32_10.zip. Of course you can rename it to libSDL2.a , and overwrite your current one, but then you will only able to use mesa since.
I'm planning to add mesa support to SDL3 and probably SDL2, but you should note that upstream stopped releasing SDL2. People should start to use SDL3.
That would be wonderful. Please, add it on SDL2 as well, if possible. There are still plenty of projects that didn't make the switch. As a matter of fact, I am porting one of them these days, which although is maintained, they didn't switch to SDl3 yet.
I completely agree with Walkero—even older projects built with SDL2 without Mesa can benefit from being updated. And there’s still so much SDL2 stuff that SDL3 just doesn’t fully support yet. In my opinion, it’s really worth it because Mesa gives us a huge performance boost. So please make it happen.
MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE / AmigaOne x5000/40 AmigaOs4.1 FE
SDL2 for sure must to have, almost everything still on SDL2 and migration will take years for many projects. But some projects even today still stay on SDL1, so even SDL1 worth updating, but if not, at least SDL2 for sure.
Hi Guys, I need your help please. I am reinstalling amigaos4 on a brand new ssd and now I am looking for the latest port with all the related libs about SDL,SDL2 and SDL 3 (mixer library, sound library and so on..). Are all available on OS4Depot or are they spread all around internet? like for example github? Thanks
If you want to support MiniGL, Ogles2 and Mesa at the same time, then you need to move their headers into separate directories and "route" headers via <GL/gl.h>, <GLES2/gl2.h> using preprocessor.