无法使用 gcc 编译 SDL 源文件

无法使用 gcc 编译 SDL 源文件

我下载了一本 SDL 图形编程入门手册,所以我尝试编译我的第一个源代码,它记录了下一个错误

编译它的命令是:

$ gcc helloWorld.c [-o helloWorld] $(sdl-config --cflags --libs)

日志如下:

gcc: error: [-o: No such file or directory
gcc: error: helloWorld]: No such file or directory

答案1

请勿在命令中使用 [ 括号 ]。尝试以下操作:

$ gcc helloWorld.c -o helloWorld $(sdl-config --cflags --libs)

相关内容