If you have not done so before, you probably want to brew install glew and brew install glfw and/or whatever other external libraries you use.(When just getting started, you might want to cut down on the deprecation warnings as OpenGL went through major changes in the past decade, using -Wno-deprecated).Add those frameworks to your C/C++ extension settings as well.You have to add OpenGL and other libraries via the framework flag.The APPLE paths are slightly different not everything is in (e.g.
(and again: it would be very similar when using clang or clang++) Don't forget: Add those frameworks to your C/C++ extension settings and/or tasks.json as well.gcc -o ex1 ex1.c -framework GLUT -framework OpenGL -Wno-deprecated.In order to run, add framework to your build arguments (to include external libraries), e.g.Mac has for part of it, and for glut files) TL DRĪs this Github Gist and this StackOverflow post both suggest: The main issue for me was that I am on MAC and many explanations were only targeted at Linux and Windows (which don't have the framework parameter) or they explain how to set it all up in the Xcode GUI.
Compilation depends on the OS and environment.