Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些 C++ 做 OpenGL 绘图,并试图弄清楚如何包含 opengl 标头,而不会在 obj-c 代码中给我带来数千个错误。
我没有收到任何错误。 你在做什么
#include <OpenGLES/ES1/gl.h>
?
您可以将文件另存为 .mm 而不是 .cpp。您仍然可以在其中使用 C++ 函数,但您也可以#import 您需要的各种包含文件,以及在代码中混合 C++ 和 Obj-C。