SDL library error: cannot find -lSDL_ttf cannot find -lSDL_image

Deadly 提交于 2020-01-15 10:50:08

问题


I'm running a C++ program using sdl, my ubuntu version is 16.04. After I sudo apt-get install libsdl1.2-dev and run the following displays :

g++ sdl-config --cflags -g -W -Wall -Weffc++ -Wextra -pedantic -O0 main.cpp -o run generateFrames.o sdl-config --libs -lSDL_ttf -lSDL_image

/usr/bin/ld: cannot find -lSDL_ttf

/usr/bin/ld: cannot find -lSDL_image

collect2: error: ld returned 1 exit status

Makefile:10: recipe for target 'run' failed

make: *** [run] Error 1

How to get rid of this error ?


回答1:


You only installed SDL library. SDL_image and SDL_ttf are different libraries. You can download them via sudo apt-get install libsdl-image1.2-dev libsdl-ttf2.0-dev. There is also another popular SDL extension SDL_mixer: libsdl-mixer1.2-dev



来源:https://stackoverflow.com/questions/39645180/sdl-library-error-cannot-find-lsdl-ttf-cannot-find-lsdl-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!