Linking SDL2 Library with my Eclipse MacOSX

I can't get my SDL2 Library working on my Eclipse. I managed to link my Headerfiles with Eclipse. But where are the SDL2.a files? I tried to just link the SDL.framework file to my Eclipse, but when I write (#include <SDL2> #include <SDL.h>) it executes some Errors and I have to close my Eclipse. When I just type (#include <SDL.h>) I get 2 Errors ->

make: *** [test] Error 1
symbol(s) not found for architecture x86_64

And if I type (#include <SDL2/SDL.h>) i get Errors like:

-fatal error: 'SDL2/SDL.h' file not found

-Invalid arguments '
Candidates are:
SDL_Window * SDL_CreateWindow(const char *, int, int, int, int, unsigned int)

-make: *** [src/test.o] Error 1

-Symbol 'SDL_WINDOWPOS_CENTERED' could not be resolved

How do I have to link the SDL2.Framework file with Eclipse?


I can't get my SDL2 Library working on my Eclipse. I managed to link my Headerfiles with Eclipse. But where are the SDL2.a files? I tried to just link the SDL.framework file to my Eclipse, but when I write (#include <SDL2> #include <SDL.h>) it executes some Errors and I have to close my Eclipse. When I just type (#include <SDL.h>) I get 2 Errors ->

make: *** [test] Error 1
symbol(s) not found for architecture x86_64

And if I type (#include <SDL2/SDL.h>) i get Errors like:

-fatal error: 'SDL2/SDL.h' file not found

-Invalid arguments '
Candidates are:
SDL_Window * SDL_CreateWindow(const char *, int, int, int, int, unsigned int)

-make: *** [src/test.o] Error 1

-Symbol 'SDL_WINDOWPOS_CENTERED' could not be resolved

How do I have to link the SDL2.Framework file with Eclipse?

I've already included the SDL2.Framework and SDL2.Framework/Versions/A/Headers in my Includes and in my Library Search Paths I've linked /Library/Frameworks/SDL2.framework.

What do I have to link different to get my SDL2 working?

I would be happy for support. I've watched several Tutorials and other Forum posts and nothing could solve my problem.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

#include <iostream>
#include <SDL2/SDL.h>
using namespace std;

int main(int argc, char* argv[]) {
    
    SDL_Init(SDL_INIT_EVERYTHING);

  
    SDL_Window *window = 0;

    window = SDL_CreateWindow("Hello World!",
                              SDL_WINDOWPOS_CENTERED,
                              SDL_WINDOWPOS_CENTERED,
                              640, 480,
                              SDL_WINDOW_SHOWN);

    
    SDL_Delay(2000);

   
    SDL_DestroyWindow(window);
    SDL_Quit();

    return 0;
}
Topic archived. No new replies allowed.