Forum > Graphics
SDL2: Runtime Error 216 on MacOS-arm
mischi:
Hi.
In a minimal SDL2 program SDL_CreateWindow creates Runtime Error 216 on macOS-arm (macOS 15.2). The attachment is a minimal stripped down version, which still creates the error. Any modification I could imagine, including a complete declaration of PSDL_Window, did not change anything and I am at the end of wisdom. Any hints are welcome. Does the example run on other platforms? A corresponding example in C runs without problems.
SDL2 is installed using MacPorts and resides in /opt/local. The command to compile the example is:
Log:
michael@Hal-9001 Pascal % fpc Test1.pas -Fl/opt/local/lib
Free 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.1 sec
michael@Hal-9001 Pascal % ./Test1
Runtime error 216 at $0000000189880F50
$0000000189880F50
$000000018987F334
$000000018987EEB4
$000000018987EB3C
$0000000189AD23F4
$0000000102806528
$00000001027EB66C
$0000000102460D08
TRon:
Is there a particular reason to use your own defines library headers and not use the standard SDL2 units.
Does the example code work with the standard headers ?
Did you also install opengl ?
Seenkao:
--- Quote from: TRon on January 13, 2025, 01:56:39 am ---Did you also install opengl ?
--- End quote ---
Разве надо на Mac надо включать OpenGL? На нём вроде по умолчанию идёт.
Google translate:
Do you really need to enable OpenGL on a Mac? It seems to work by default.
mischi, включите отладочную информацию в проекте, тогда может более точную ошибку увидите.
Google translate:
mischi, enable debug information in the project, then maybe you will see a more precise error.
TRon:
--- Quote from: Seenkao on January 13, 2025, 02:33:07 am ---Do you really need to enable OpenGL on a Mac? It seems to work by default.
--- End quote ---
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.
mischi:
--- Quote from: TRon on January 13, 2025, 01:56:39 am ---Is there a particular reason to use your own defines library headers and not use the standard SDL2 units.
Does the example code work with the standard headers ?
Did you also install opengl ?
--- End quote ---
The error showed up using the standard SDL2 units. The only reason for having my own library headers is to reduce the level of complexity of the example. OpenGL is part of macOS as Seenkao mentioned.
Navigation
[0] Message Index
[#] Next page