#Holy, I'm about to lose my mind

86 messages · Page 1 of 1 (latest)

crisp wind
#

I'm trying to setup openGL on my mac M1 but its impossible. I just can't. I can't. Idk why tf I can't. I can send you everything you ask for, the code, the tasks.json but I keep getting THE SAME FKING ERROR
fatal error: 'GLFW/glfw3.h' file not found
1 | #include <GLFW/glfw3.h>
| ^~~~~~~~~~~~~~
1 error generated.

LIKE BRO ITS BEEN 5 HOURS AND ITS STILL AT THIS. I CHANGED ALL MY FILE DIRECTORIES, THE SAMPLE CODE, THE JSON FILE, EVERYTHING

tardy tideBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

hoary cobalt
crisp wind
hoary cobalt
#

is glfw.h in your include folder? @crisp wind

crisp wind
hoary cobalt
#

your folder is named "glfw"? or "GLFW"

#

like basically make sure

#

your #include says "GLFW/glfw3.h"

crisp wind
hoary cobalt
#

So your directory tree is like:

In your working directory:
helloworld.cpp

folder include -> folder GLFW -> glfw3.h

crisp wind
#

that after that you know

hoary cobalt
#

oh

#

you need to change

#

right now you have: #include <GLFW/glfw3.h>

But it needs to be: #include "directories/include/GLFW/glfw.h" since that is the path relative to your source file helloworld.cpp

crisp wind
#

oh and do i just click run, or do i type some special thing in terminal like ./app?

hoary cobalt
#

add that, compile, then run

crisp wind
hoary cobalt
#

just add that and click run

#

compile is automatically done

#

with visual studio code

crisp wind
#

ah ok

junior palm
#

You can add -I./directories/include/ (GCC/Clang) to your compiler (or something similar) to not use relative paths.

crisp wind
#

apparently it says it cant open dependencies/GLFW/glfw.h yeah the folder was dependencies and not directories mb

hoary cobalt
#

that means the path might be wrong

#

can u take a screen recording of what you are doing to run right now? And also include showing your folder tree

crisp wind
#

now there's no error

#

fuck nvm what

#

helloworld.cpp:1:10: error: 'dependencies/include/GLFW/glfw3.h' file not found with <angled> include; use "quotes" instead
1 | #include <dependencies/include/GLFW/glfw3.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| "dependencies/include/GLFW/glfw3.h"
helloworld.cpp:26:9: warning: 'glClearColor' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
26 | glClearColor(0.2f, 0.3f, 0.8f, 1.0f);
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2396:13: note: 'glClearColor' has been explicitly marked deprecated here
2396 | extern void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) OPENGL_DEPRECATED(10.0, 10.14);
| ^
helloworld.cpp:29:9: warning: 'glClear' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
29 | glClear(GL_COLOR_BUFFER_BIT);
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2394:13: note: 'glClear' has been explicitly marked deprecated here
2394 | extern void glClear (GLbitfield mask) OPENGL_DEPRECATED(10.0, 10.14);
| ^
2 warnings and 1 error generated.

hoary cobalt
#
helloworld.cpp:1:10: error: 'dependencies/include/GLFW/glfw3.h' file not found with <angled> include; use "quotes" instead
    1 | #include <dependencies/include/GLFW/glfw3.h>
      |          ^~~~~~~~~~~
      |          "dependencies/include/GLFW/glfw3.h"

First fix this error, ignore the rest. Just change your <> to ""

junior palm
crisp wind
hoary cobalt
#

yup

crisp wind
#

warning: 'glClearColor' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
26 | glClearColor(0.2f, 0.3f, 0.8f, 1.0f);
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2396:13: note: 'glClearColor' has been explicitly marked deprecated here
2396 | extern void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) OPENGL_DEPRECATED(10.0, 10.14);
| ^
helloworld.cpp:29:9: warning: 'glClear' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
29 | glClear(GL_COLOR_BUFFER_BIT);
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2394:13: note: 'glClear' has been explicitly marked deprecated here
2394 | extern void glClear (GLbitfield mask) OPENGL_DEPRECATED(10.0, 10.14);
| ^

#

2 warnings generated.
Undefined symbols for architecture arm64:
"_glClear", referenced from:
_main in helloworld-b21623.o
"_glClearColor", referenced from:
_main in helloworld-b21623.o
"_glfwCreateWindow", referenced from:
_main in helloworld-b21623.o
"_glfwInit", referenced from:
_main in helloworld-b21623.o
"_glfwMakeContextCurrent", referenced from:
_main in helloworld-b21623.o
"_glfwPollEvents", referenced from:
_main in helloworld-b21623.o
"_glfwSwapBuffers", referenced from:
_main in helloworld-b21623.o
"_glfwTerminate", referenced from:
_main in helloworld-b21623.o
_main in helloworld-b21623.o
"_glfwWindowHint", referenced from:
_main in helloworld-b21623.o
"_glfwWindowShouldClose", referenced from:
_main in helloworld-b21623.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

#

my god its almost joever

hoary cobalt
#

ok, looks like u got a lotta things messed up

junior palm
hoary cobalt
#

i have time right now and im on my mac m1, how about i record a video setting everything up and u can just follow that step by step?

#

like a screen recording

crisp wind
#

thats cool

#

please do that

hoary cobalt
#

gotchu bro i was in ur boat 2 years ago i know how it feels

crisp wind
junior palm
crisp wind
crisp wind
#

its so joever

hoary cobalt
#

hol on im getting it to work rn

#

for me first

#

in 10 minutes maybe itll be ready

crisp wind
#

take yo time

hoary cobalt
#

alright got it working for me,

#

time to record the video

crisp wind
#

otherwise, its gonna be a never for me

crisp wind
hoary cobalt
#

@crisp wind before u can follow u need to do 1 step

hoary cobalt
#

do you have homebrew installed?

crisp wind
hoary cobalt
#

ok can u check by typing "brew list" into your terminal

crisp wind
#

==> Formulae
boost glfw openssl@3
brotli glog pcre2
c-ares icu4c@76 python@3.13
ca-certificates idb-companion readline
cocoapods ios-deploy ruby
double-conversion libevent snappy
edencommon libnghttp2 sqlite
fb303 libsodium wangle
fbthrift libuv watchman
fizz libyaml xxhash
fmt lz4 xz
folly mpdecimal zstd
gflags node

#

this is all it gave me

hoary cobalt
#

alright then u have it installed

crisp wind
#

w

crisp wind
#

its taking time huh

hoary cobalt
#

compressing the vid right now so i can send it

crisp wind
#

.mov really is a fatass

hoary cobalt
#

Also make sure to rename the folders after you unzip to what they were named in the video.

Secondly when you unzip the folders that only have 1 file, its just gonna unzip that file, you need to put it in a folder named accordingly still

crisp wind
#

yoooooo wwww

hoary cobalt
#

does it work?

crisp wind
#

im deleting the folder rn

#

do i delete my cpp stuff as well, or do i just make the build inside that

crisp wind
hoary cobalt
#

like doing what i did

crisp wind
#

alr

crisp wind
hoary cobalt
#

ye

#

just put that inside a folder called lib like in the video