简体   繁体   中英

Unable to compile SDL in linux

I use the following code in the ubuntu terminal to compile my sdl code:

g++ SDL.cpp -o a.out -lsdl -lsdl_gfx 

and i get this error:

/usr/bin/ld: cannot find -lsdl  
/usr/bin/ld: cannot find -lsdl_gfx  
collect2: ld returned 1 exit status

Any idea what this means?

g++ SDL.cpp -I/usr/include/SDL -lSDLmain -lSDL_gfx -lSDL

确保已安装SDL_gfx,因为它是一个单独的可选模块。

我相信这可以做到:

g++ SDL.cpp -o a.out -lSDL_gfx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM