![rosxnb](/img/default-banner.jpg)
- Видео 1
- Просмотров 45 879
rosxnb
Добавлен 4 авг 2021
OpenGL setup: GLFW and GLAD in Visual Studio Code on macOS
Contents of the video:
00:00 Intro
01:00 GLFW download and project setup
03:03 VS Code default build task configuration
06:46 Glad download
Homebrew : brew.sh
GLAD : glad.dav1d.de
Sample code 1 : www.glfw.org/documentation.html
Sample code 2 : learnopengl.com/code_viewer_gh.php?code=src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp
--------------------------------------------------
--------------------tasks.json--------------------
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-std=c++17",
"-fdiagnostics-color=always",
"-Wall",
"-g",
"-I${workspaceFolder}/dependencies/include",
"-L${workspaceFol...
00:00 Intro
01:00 GLFW download and project setup
03:03 VS Code default build task configuration
06:46 Glad download
Homebrew : brew.sh
GLAD : glad.dav1d.de
Sample code 1 : www.glfw.org/documentation.html
Sample code 2 : learnopengl.com/code_viewer_gh.php?code=src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp
--------------------------------------------------
--------------------tasks.json--------------------
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-std=c++17",
"-fdiagnostics-color=always",
"-Wall",
"-g",
"-I${workspaceFolder}/dependencies/include",
"-L${workspaceFol...
Просмотров: 45 887
{ "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: clang++ build active file", "command": "/usr/bin/clang++", "args": [ "-std=c++17", // C++ Version "-fcolor-diagnostics", "-fansi-escape-codes", "-Wall", // Enable all warnings "-g", "-I${workspaceFolder}/dependencies/include", // Specifying path to include files "-L${workspaceFolder}/dependencies/library", // Specify path for our library "${workspaceFolder}/dependencies/library/libglfw.3.4.dylib", // "${workspaceFolder}/*.cpp", // Specify which file to Execute...( Now all the CPP files .) "${workspaceFolder}/glad.c", "-o", "${workspaceFolder}/app", // "${fileDirname}/${fileBasenameNoExtension}" ---> Name of application -- in Terminal ./app "-framework", // Additional frame work "OpenGL", "-framework", "Cocoa", "-framework", "IOKit", "-framework", "CoreVideo", "-framework", "CoreFoundation", "-Wno-deprecated" // Disable dipreciation warnings ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": ["$gcc"], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: /usr/bin/clang++" } ] }
Thanks a lot
fatal error: 'glad/glad.h' file not found #include <glad/glad.h> ^~~~~~~~~~~~~ 1 error generated. i go this error please help
{ "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: clang build active file", "command": "/usr/bin/clang", "args": [ "-std=c++17", "-fcolor-diagnostics", "-fansi-escape-codes", "-Wall", "-g", "-I/opt/homebrew/opt/glfw/include", // Updated include path "-L/opt/homebrew/opt/glfw/lib", // Updated library path "-lglfw", // Link GLFW library "-lc++", // Link with the C++ standard library "${workspaceFolder}/*.cpp", // Source files "-o", "${workspaceFolder}/app", // Output executable "-framework", "OpenGL", "-framework", "Cocoa", "-framework", "IOKit", "-framework", "CoreVideo", "-framework", "CoreFoundation", "-Wno-deprecated" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: /usr/bin/clang" } ] } use this it will work
thanks a lot. you are doing god's work. exactly what I needed.
I have done everything as you said, and it built but did't want to run app. I found out that i needed to add one more line in the task.json inside args "-Wl,-rpath,@executable_path/lib" and now it works perfectly. Thanks very much.
Helped a lot thanks
thank you very much!
Does GLEW need to be installed as well?
hi can you also explain how to add GLUT too?
I got an error: clang: error: no such file or directory: '/Users/.../Desktop/youtube/*.cpp'
build is taking forever, anyone have any ideas?
thanks for the video. you fix in a 4 min what I was stuck in for the past 3 to 5 hours, keep the grease work
nice number of subs, my guy
Best one! Really help me figure out how to build OpenGL with vscode
After repeating what you did, it gives me "clang: error: linker command failed with exit code 1 (use -v to see invocation)". I would appreciate if someone helps me. P.S I am using glfw 3.3.9
Worked perfectly in mac M1, thank you!
can u instruct me include glut library
fuck this video it didnt work
You have no idea how much this tutorial helped me. I was struggling to find a good tutorial for this EXACT thing and you did it perfectly and clearly.
Thank you so much bro
Simple and straight to the point, thanks!
why i do not have the c/c++ compiler?
Buy a PC, Macs are garbage!
Amazing thanks!
i need help. my error is: error: invalid argument '-std=c++17' not allowed with 'C'. how do i right now
clang: error: no such file or directory: '/Users/siddhantmishra/Desktop/ OpenGl*.cpp' how to fix this error
I had followed all the steps.. but there showed me this error......."'GLFW/glfw3.h' file not found". this file is on the right place, but probably the compiler can't detect it.. what would I do to solve this..??
have you figured out how to solve this error? I have the same
@@Aaans-bd8ep Yes, I did.
how? lol @@ankansaha3260
{ "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: clang build active file", "command": "/usr/bin/clang", "args": [ "-std=c++17", "-fcolor-diagnostics", "-fansi-escape-codes", "-Wall", "-g", "-I/opt/homebrew/opt/glfw/include", // Updated include path "-L/opt/homebrew/opt/glfw/lib", // Updated library path "-lglfw", // Link GLFW library "-lc++", // Link with the C++ standard library "${workspaceFolder}/*.cpp", // Source files "-o", "${workspaceFolder}/app", // Output executable "-framework", "OpenGL", "-framework", "Cocoa", "-framework", "IOKit", "-framework", "CoreVideo", "-framework", "CoreFoundation", "-Wno-deprecated" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: /usr/bin/clang" } ] } use this it will work
dude speak louder, damn.
Thanks so much for this!!
Hi I am getting this error dyld[74341]: Library not loaded: @rpath/libglfw.3.dylib after running ./app in the terminal. Can you please help with this
did you solve the issue? am getting the same one
same
Hello. Thanks for this guide, I'm about to start a course that needs OpenGL and I only have a mac laptop so this is great. While trying to run Sample code 1 I get this error: Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Could you please help me.
This is what I have been looking for ages, THANK!!
Great simple and easy tutorial. Thank you! You can also change the file type to be glad.cpp as well to avoid adding the extra path to the args list
Thank you so much, I was looking for a tutorial for like hours until I finally saw your video, and it is working, thanks once again!
Большое спасибо, добрый человек
I choose the same default build task however my args structure is different, is this normal and do I need to change it?
Hi I am getting warning saying ld: warning: dylib was built for newer macOS version (13.0) then being linked (12.3). Do you have any suggestions? I am using the most up to date version of glfw and my Mac is 13?
Works on M1 macbook! Thanks!
I wanna say thank you! I would gone crazy trying to set up all without your video...thanks for sharing!
I love indian programming tutorials
anyone else have the issue of not being able to open the source code for the header file?
I'm experiencing the same problem. Works fine initially but once i try to set up glad and test the new code to build it i get errors. Well i was gonna complain more, but it after moving the file out of the folder and then putting it back in for some reason it miraculously worked... Not sure what i did. Like i am still geting error glad/glad.h file not found but it bypassed it and i got it to print the triangle
after continuing on with the tutorial i still have an issue where it fails tp build successfully saying that there isn't a glad header folder to find/use when there clearly is one
i've followed your steps correctly up until the build but it gives me "clang: error: no such file or directory: '/Users/monsieurpipes/local_Uni_Files/2nd Year/comp2006/cw2/*.cpp' clang: error: no such file or directory: '/Users/monsieurpipes/local_Uni_Files/2nd Year/comp2006/cw2/glad.c'" any ideas why??
Hey. Mine is stuck at "Starting build..." for over 15mins now. Do you have any clue why? No other errors.
it's a great begin , thanks
i made a mistake creating the main.cpp under the dependancy folder, im so dumbbb
Thank you !Thats is really helpful and clear
I cant start build after using conmand shift B ....what happened?or is there any other way to build?
OK I found it in just under Terminal
How to run the code after "build run sucessfully"
you could just type "./app" in the terminal. Make sure you are in the right directory and you can see the "app" file. we name the executable as "app" with following command in the tutorial { "-o", "${workspaceFolder}/app" }
amazing videos, you saved my life.