使用 make 命令

使用 make 命令

我按照作者为懒惰程序员提供的 c++20 入门说明进行操作。说明是进入 external/SSDL/unix,然后输入 make。我这样做了,但收到错误消息。这是我在终端中看到的内容。

/Desktop/lazy/cpp20/external/SSDL/unix$ make
make -C bin/shared
make[1]: Entering directory '/home/michael/Desktop/lazy/cpp20/external/SSDL/unix/bin/shared'
g++ -c -fPIC `sdl2-config --cflags` -I../../../include  ../../../src/SSDL_color.cpp -o SSDL_color.o
/bin/sh: 1: sdl2-config: not found
In file included from ../../../src/SSDL_color.cpp:23:
../../../include/SSDL_color.h:26:10: fatal error: SDL.h: No such file or directory
   26 | #include "SDL.h"
      |          ^~~~~~~
compilation terminated.
make[1]: *** [Makefile:37: SSDL_color.o] Error 1

我该如何纠正这个问题?谢谢帮助

答案1

你似乎错过了头文件对于 SDL。在 Ubuntu 中,头文件通常可以在dev名称中包含的包中找到。我的第一个想法是尝试使用包libsdl2-dev,但您可能需要再检查一下。

相关内容