0

I am starting to learn programming in C and would like to try game programming using a library called Raylib.

I did follow the documentations to setup a C project in Xcode:

  1. Create a new C project using command line tool in Xcode
  2. Under Build Phases add OpenGL.framework, CoreVideo.framework, IOKIT.framework, Cocoa.framework, libraylib.a
  3. In Build Settings -> Search path add header and library folder

This is the code in main.c:

#include "include/raylib.h"

int main(void)
{
    // Initialization
    //--------------------------------------------------------------------------------------
    const int screenWidth = 800;
    const int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");

    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second
    //--------------------------------------------------------------------------------------

    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update
        //----------------------------------------------------------------------------------
        // TODO: Update your variables here
        //----------------------------------------------------------------------------------

        // Draw
        //----------------------------------------------------------------------------------
        BeginDrawing();

            ClearBackground(RAYWHITE);

            DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);

        EndDrawing();
        //----------------------------------------------------------------------------------
    }

    // De-Initialization
    //--------------------------------------------------------------------------------------
    CloseWindow();        // Close window and OpenGL context
    //--------------------------------------------------------------------------------------

    return 0;
}

The project build successfully with the warning OpenGL is deprecated and the executing abort with payload:

dylid'__abort_with_payload:

5 ->  0x10005a0ce <+10>: jae    0x10005a0d8  ; <+20>  Thread1: signal SIGABRT

Since I am a complete beginner with C I have no idea what this "abort with payload" actually means and how to debug it. Tried to ask for help on Raylib Discord but received no reply.

Running: macOS 12.1 Xcode 13.2.1 Raylib 4.0

Could someone tell me what the problem might be or why is this "abort with payload" is happening?

I would appreciate any help.

Thank you.

ddabrahim
  • 77
  • 6
  • Thanks. There are many possible causes listed in that topic. It is going to take some time to go through them all, but I guess the solution must be there. – ddabrahim Feb 15 '22 at 10:06

0 Answers0