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

后端 未结 6 941
情深已故
情深已故 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:56

    the simplest idea is to add pkg-config --cflags --libs sdl2 while compiling the code.

    g++ file.cpp `pkg-config --cflags --libs sdl2`

提交回复
热议问题