'“SDL.h” no such file or directory found' when compiling

后端 未结 6 1096
情深已故
情深已故 2021-01-31 18:07

Here\'s a piece of my current Makefile:

CFLAGS = -O2 -Wall -pedantic -std=gnu++11 `sdl-config --cflags --libs` -lSDL_mixer

I have libsdl instal

6条回答
  •  忘掉有多难
    2021-01-31 18:59

    For Simple Direct Media Layer 2 (SDL2), after installing it on Ubuntu 16.04 via:

    sudo apt-get install libsdl2-dev
    

    I used the header:

    #include   
    

    and the compiler linker command:

    -lSDL2main -lSDL2 
    

    Additionally, you may also want to install:

    apt-get install libsdl2-image-dev  
    apt-get install libsdl2-mixer-dev  
    apt-get install libsdl2-ttf-dev  
    

    With these headers:

    #include 
    #include 
    #include   
    

    and the compiler linker commands:

    -lSDL2_image 
    -lSDL2_ttf 
    -lSDL2_mixer
    

提交回复
热议问题