Xcode Thread 1: signal SIGABRT

Hello, it's my first post here, and I would like to ask if someone knows how to fix the error Thread 1:signal SIGABRT of Xcode. I use C++ (I'm new to C++ btw, but I know the basics like variables, pointers, class...) and every time I include SDL, the code is correctly built, but it immediately returns a Thread 1: signal SIGABRT when running.

I don't know what's happening and I don't know if I did something wrong with Xcode. Let me know if anyone knows what's happening.

The error returned by Xcode is the following :

dyld`:

    0x188203188 <+0>:  mov    x16, #0x209

    0x18820318c <+4>:  svc    #0x80

->  0x188203190 <+8>:  b.lo   0x1882031b0               ; <+40>

    0x188203194 <+12>: pacibsp 

    0x188203198 <+16>: stp    x29, x30, [sp, #-0x10]!

    0x18820319c <+20>: mov    x29, sp

    0x1882031a0 <+24>: bl     0x188194e68               ; cerror_nocancel

    0x1882031a4 <+28>: mov    sp, x29

    0x1882031a8 <+32>: ldp    x29, x30, [sp], #0x10

    0x1882031ac <+36>: retab  

    0x1882031b0 <+40>: ret   
And the terminal returns that : 
dyld[1232]: Library not loaded: @rpath/SDL2_image.framework/Versions/A/SDL2_image

  Referenced from: <1AB20B9B-5E8A-342C-8B07-915BE26B1407> /Users/<myUsername>/Library/Developer/Xcode/DerivedData/incollables_sdl-cgoptdlqmlhbdrdvozpsuhggfwby/Build/Products/Debug/incollables sdl

  Reason: tried: '/Users/<myUsername>/Library/Developer/Xcode/DerivedData/incollables_sdl-cgoptdlqmlhbdrdvozpsuhggfwby/Build/Products/Debug/SDL2_image.framework/Versions/A/SDL2_image' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/SDL2_image.framework/Versions/A/SDL2_image' (no such file), '/Library/Frameworks/SDL2_image.framework/Versions/A/SDL2_image' (code signature in <28F012AC-3044-3B29-A80E-93FE4DB43080> '/Library/Frameworks/SDL2_image.framework/Versions/A/SDL2_image' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Library/Frameworks/SDL2_image.framework/Versions/A/SDL2_image' (no such file, not in dyld cache)

(lldb) 

As I said, I'm new to C++, and I'm not familiar with the errors returned by the compiler.

The error message is saying that the SDL2_image framework can't be found.

For anyone to be able to help you, you must provide more information. List the steps you took to create the Xcode project and add the SDL frameworks to your project. Be very specific because the people on this forum aren't standing next to you. They can only go by what you write here.

Not many people on this forum use SDL. You may have better luck asking this question in a game development forum where people use SDL.

Sorry, here are more informations : I created a Console App and I added SDL2.framework and SDL2_image.framework in the build phases. I wrote a simple class that creates a window. I added #include <SDL2/SDL.h> in all the files. (I followed the LazyFoo tutorial for the code).

PS. If you don't use SDL, then what library do you use ?

If you want to make a game, I recommend using a game engine like Unity or Godot or using Apple's SpriteKit framework. Use a game engine if you want your game to run on non-Apple platforms.

If you really want to use SDL in Xcode, start over by creating a new project. Your screenshot shows a command-line tool project. The problem with a command-line tool project on Mac is that it doesn't create an app bundle for the game. Creating an app bundle makes it easier to load graphics, sounds, and other files in your game code.

According to the SDL Mac instructions on their GitHub page,

https://github.com/libsdl-org/SDL/blob/main/docs/README-macos.md

The Mac download of SDL includes Xcode project templates. Install the templates and use them to create the Xcode project. The link also has instructions on how to set up a new project by hand.

Xcode Thread 1: signal SIGABRT
 
 
Q