Advertisement

How do you people ever get past this?

Started by June 02, 2024 07:41 AM
13 comments, last by bhvrbhrr 6 months, 3 weeks ago

OpenGL on Mac could be tricky to make it work. From a certain version of the OS, Apple did a lot to prevent people from using GL in favor of Metal. But it is still possible. I don't remember the exact steps, but google will surely help you.

Also, I believe that there are issues with glew. You should try glad instead. Build you own version from the website and use it.

bhvrbhrr said:

The error

/Users/baguma/desktop/graf/main.cpp:4:10: fatal error: 'GL\glew.h' file not found
#include <GL\glew.h>
         ^~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/ogle.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/ogle.dir/all] Error 2
make: *** [all] Error 2

The thing is, glew was found. I saw it while setting up the makefile with cmake. So why would I still get this error.

I'm using vscode on mac because system is too old. 2015 MBP 13" and Xcode isn't supported.

Well, in this case the error is obviously that you are using a backslash (\) instead of a forward slash (/) as a path separator.

Advertisement

@Aressera Yeah, it reserves them for paid members. But I got Xcode 14 yesterday . I can't figure out how to link glfw, glad, assimp, freetype packages which I installed with homebrew. Every tutorial on youtube is at least 7 years old (the most relevant to what Im looking for)

Why do MacUsers avoid Xcode? i have been using it for a few hours and already this is a huge improvement. It highlights my syntactical errors in a much less annoying way, with clear helpful info than vscode. But why does it seem like not manny people use it? Or is it that those who do(and are many are a silent majority – too busy coding to make any tutorial content.

Its wild. I almost gave up on C++ but I may have to reconsider, thanks to Xcode.

TLDR: How do I get glfw, glad, assimp, freetype packages linked so that I can render my first OpenGL triangle? Also, the relevant files for imgui and glad

@Aressera I have managed to link everything but I have one problem. If I started a project as a C++ project but it depends on some .c files, how do I add them to the project folder? I opened the folder on my desktop and dragged and dropped the .c files where my main.cpp is but in the xcode app, it didn't reflect the changes.

I had to manually copy the contents of each .c file into my main.cpp for it to run. Not a great way to do it!

This topic is closed to new replies.

Advertisement