Do you really need to enable OpenGL on a Mac? It seems to work by default.
I have no idea what opengl library version SDL expects or what OpenGL auxiliary libraries SDL depends on for a mac.
You might be perfectly right that this does not matter for a mac but, I honestly don't know.
@mischi:
Besides the request from Seenkao to enable debug (which can be a bit tricky for a mac: requires external debug symbols and a particular debug format) some output along the way might be able to help as well. Right now there is no hint whatsoever at what function exactly the code fails.
Log with debug switched on:
michael@Hal-9001 Pascal % fpc -gw2 -gl Test1.pas -Fl/opt/local/libFree Pascal Compiler version 3.2.2 [2024/11/27] for aarch64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Darwin for AArch64
Compiling Test1.pas
Assembling test1
Linking Test1
ld: warning: ignoring duplicate libraries: '-lc'
45 lines compiled, 0.3 sec
michael@Hal-9001 Pascal % lldb Test1(lldb) target create "Test1"
Current executable set to '/Users/michael/Developer/SDL2 Trial/Pascal/Test1' (arm64).
(lldb) runProcess 7693 launched: '/Users/michael/Developer/SDL2 Trial/Pascal/Test1' (arm64)
2025-01-13 10:16:48.226151+0100 Test1[7693:22258102] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000bb0600> F8BB1C28-BAE8-11D6-9C31-00039315CD46
Process 7693 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=1, subcode=0x1e683920)
frame #0: 0x0000000189880f50 AppKit`_NSGetCGFloatAppConfig + 216
AppKit`_NSGetCGFloatAppConfig:
-> 0x189880f50 <+216>: fsub d0, d9, d8
0x189880f54 <+220>: fneg d1, d0
0x189880f58 <+224>: fcmp d0, #0.0
0x189880f5c <+228>: fcsel d10, d1, d0, mi
Target 0: (Test1) stopped.
(lldb) bt* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=1, subcode=0x1e683920)
* frame #0: 0x0000000189880f50 AppKit`_NSGetCGFloatAppConfig + 216
frame #1: 0x000000018a3612fc AppKit`NSWindowResolvedScaleFactor + 484
frame #2: 0x000000018987f334 AppKit`-[NSWindow _commonInitFrame:styleMask:backing:defer:] + 288
frame #3: 0x000000018987eeb4 AppKit`-[NSWindow _initContent:styleMask:backing:defer:contentView:] + 876
frame #4: 0x000000018987eb3c AppKit`-[NSWindow initWithContentRect:styleMask:backing:defer:] + 48
frame #5: 0x0000000189ad23f4 AppKit`-[NSWindow initWithContentRect:styleMask:backing:defer:screen:] + 24
frame #6: 0x00000001004ce528 libSDL2-2.0.0.dylib`Cocoa_CreateWindow + 528
frame #7: 0x00000001004b366c libSDL2-2.0.0.dylib`SDL_CreateWindow_REAL + 1200
frame #8: 0x0000000100000d0c Test1`PASCALMAIN at Test1.pas:37:13
frame #9: 0x000000010002c140 Test1`FPC_SysEntry + 32
frame #10: 0x0000000100000c10 Test1`FPC_SYSTEMMAIN + 80
frame #11: 0x0000000100000c68 Test1`main(ARGC=1, ARGV=0x000000016fdff5e8, ARGP=0x000000016fdff5f8) + 40
frame #12: 0x000000018589c274 dyld`start + 2840