如何包括正确:或,我/ usr / include / SDL2吗?

时间:2021-05-13 20:13:07

How to include correct with using gcc: <SDL2/SDL.h> or <SDL.h> and set -I/usr/include/SDL2?

如何正确使用gcc: 或< SDL。h >,我/ usr / include / SDL2吗?

2 个解决方案

#1


0  

Well, either are valid, but I think its far more polite to use that one that makes the compile command easier and more obvious, ie #include , thus you dont need to alter the include search path.

嗯,这两种方法都是有效的,但是我认为使用那个使编译命令更容易和更明显的方法(包括,因此您不需要更改include搜索路径)是很有礼貌的。

#2


0  

I think this command will work:

我认为这个命令会起作用:

g++ main.cpp -I/Library/Frameworks/SDL2.framework/Headers  -F/Library/Frameworks -framework SDL2 

#1


0  

Well, either are valid, but I think its far more polite to use that one that makes the compile command easier and more obvious, ie #include , thus you dont need to alter the include search path.

嗯,这两种方法都是有效的,但是我认为使用那个使编译命令更容易和更明显的方法(包括,因此您不需要更改include搜索路径)是很有礼貌的。

#2


0  

I think this command will work:

我认为这个命令会起作用:

g++ main.cpp -I/Library/Frameworks/SDL2.framework/Headers  -F/Library/Frameworks -framework SDL2