Here is my qmake file. For whatever reason, when I try to compile the program SDL isn’t being recognized. Why is this?
LIBS += -L/usr/include/SDL.h -lSDL
HEADERS += \
render.h \
screenwriter.h
SOURCES += \
screenwriter.cpp \
render.cpp
It seems SDL uses pkgconfig:
So the best way to link with it would be to use
link_pkgconfig, instead of adding it manually toLIBS:This will automatically modify
QMAKE_CXXFLAGS,QMAKE_CFLAGS, andLIBSfor you, by callingpkg-config --cflags sdlandpkg-config --libs sdl.