我有一个项目(在这里),可以在Linux和英特尔macOS上运行,但是在我的Mac m1上不行。每当我尝试编译它时,就会出现以下错误(注意:我正在使用本机vscode m1):
pedrohaccorsi@MacBook-Air-de-Pedro dev % make
g++ -o app src/glad.c src/AudioManager.cpp src/Character.cpp src/SceneManager.cpp src/Source.cpp src/Sprite.cpp src/stb_image.cpp -g -Iinclude -F/Library/Frameworks -lglfw -ldl -framework SDL2 -I/Library/Frameworks/SDL2.framework/Headers -framework SDL2_mixer -I/Library/Frameworks/SDL2_mixer.framework/Headers
In file included from src/AudioManager.cpp:1:
include/AudioManager.h:1:10: fatal error: 'SDL2/SDL.h' file not found
#include <SDL2/SDL.h>
^~~~~~~~~~~~
1 error generated.
In file included from src/Character.cpp:1:
In file included from include/Character.h:1:
In file included from include/Sprite.h:6:
include/Shader.h:13:10: fatal error: 'GLFW/glfw3.h' file not found
#include <GLFW/glfw3.h>
^~~~~~~~~~~~~~
1 error generated.
In file included from src/SceneManager.cpp:1:
In file included from include/SceneManager.h:3:
include/Shader.h:13:10: fatal error: 'GLFW/glfw3.h' file not found
#include <GLFW/glfw3.h>
^~~~~~~~~~~~~~
1 error generated.
src/Source.cpp:10:17: warning: using directive refers to implicitly-defined namespace 'std'
using namespace std;
^
In file included from src/Source.cpp:12:
In file included from include/SceneManager.h:3:
include/Shader.h:13:10: fatal error: 'GLFW/glfw3.h' file not found
#include <GLFW/glfw3.h>
^~~~~~~~~~~~~~
1 warning and 1 error generated.
In file included from src/Sprite.cpp:1:
In file included from include/Sprite.h:6:
include/Shader.h:13:10: fatal error: 'GLFW/glfw3.h' file not found
#include <GLFW/glfw3.h>
^~~~~~~~~~~~~~
1 error generated.
make: *** [app] Error 1
在此之前,我运行了这三个命令,并且它们都成功地执行了,没有出现任何错误或警告,因此我认为一切都正常工作。
brew install glfw
brew install sdl2
brew install sdl2_mixer
有人有什么想法吗?
opt/homebrew
目录中。 - Ranoiaetep