rosxnb
rosxnb
  • Видео 1
  • Просмотров 45 879
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...
Просмотров: 45 887

Видео

Комментарии

  • @Basseloob
    @Basseloob 2 месяца назад

    { "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++" } ] }

  • @hadriencarrozgribot8590
    @hadriencarrozgribot8590 3 месяца назад

    Thanks a lot

  • @gurinderkaur6817
    @gurinderkaur6817 4 месяца назад

    fatal error: 'glad/glad.h' file not found #include <glad/glad.h> ^~~~~~~~~~~~~ 1 error generated. i go this error please help

    • @raghavav9097
      @raghavav9097 7 дней назад

      { "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

  • @viggenzz
    @viggenzz 4 месяца назад

    thanks a lot. you are doing god's work. exactly what I needed.

  • @dawidklyta2515
    @dawidklyta2515 5 месяцев назад

    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.

  • @DevelopedEgg
    @DevelopedEgg 5 месяцев назад

    Helped a lot thanks

  • @GWebcob
    @GWebcob 6 месяцев назад

    thank you very much!

  • @purassicjark
    @purassicjark 6 месяцев назад

    Does GLEW need to be installed as well?

  • @chhavi019
    @chhavi019 7 месяцев назад

    hi can you also explain how to add GLUT too?

  • @_nakhoo_
    @_nakhoo_ 7 месяцев назад

    I got an error: clang: error: no such file or directory: '/Users/.../Desktop/youtube/*.cpp'

  • @ryanliu8665
    @ryanliu8665 7 месяцев назад

    build is taking forever, anyone have any ideas?

  • @aninosspro
    @aninosspro 7 месяцев назад

    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

  • @brunocastro7858
    @brunocastro7858 7 месяцев назад

    nice number of subs, my guy

  • @aaaakko139
    @aaaakko139 7 месяцев назад

    Best one! Really help me figure out how to build OpenGL with vscode

  • @Itsme-yq7cj
    @Itsme-yq7cj 7 месяцев назад

    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

  • @vante6886
    @vante6886 8 месяцев назад

    Worked perfectly in mac M1, thank you!

  • @ngvi84
    @ngvi84 8 месяцев назад

    can u instruct me include glut library

  • @sc6ut407
    @sc6ut407 9 месяцев назад

    fuck this video it didnt work

  • @magicman02
    @magicman02 9 месяцев назад

    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.

  • @abdulhakim9537
    @abdulhakim9537 9 месяцев назад

    Thank you so much bro

  • @aomadeira
    @aomadeira 9 месяцев назад

    Simple and straight to the point, thanks!

  • @syi14
    @syi14 9 месяцев назад

    why i do not have the c/c++ compiler?

  • @HarvestrX
    @HarvestrX 10 месяцев назад

    Buy a PC, Macs are garbage!

  • @joahnoub173
    @joahnoub173 10 месяцев назад

    Amazing thanks!

  • @ilt_RIAD65
    @ilt_RIAD65 11 месяцев назад

    i need help. my error is: error: invalid argument '-std=c++17' not allowed with 'C'. how do i right now

  • @user-bb6uz2kx4v
    @user-bb6uz2kx4v 11 месяцев назад

    clang: error: no such file or directory: '/Users/siddhantmishra/Desktop/ OpenGl*.cpp' how to fix this error

  • @ankansaha3260
    @ankansaha3260 Год назад

    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..??

    • @Aaans-bd8ep
      @Aaans-bd8ep 9 месяцев назад

      have you figured out how to solve this error? I have the same

    • @ankansaha3260
      @ankansaha3260 9 месяцев назад

      @@Aaans-bd8ep Yes, I did.

    • @ryanliu8665
      @ryanliu8665 7 месяцев назад

      how? lol @@ankansaha3260

    • @raghavav9097
      @raghavav9097 7 дней назад

      { "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

  • @DeadManRising
    @DeadManRising Год назад

    dude speak louder, damn.

  • @adamspiano
    @adamspiano Год назад

    Thanks so much for this!!

  • @mrunalkadhane5883
    @mrunalkadhane5883 Год назад

    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

  • @aunesto17
    @aunesto17 Год назад

    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.

  • @maxrathbone-boschis547
    @maxrathbone-boschis547 Год назад

    This is what I have been looking for ages, THANK!!

  • @fullViewJay
    @fullViewJay Год назад

    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

  • @somabencsik
    @somabencsik Год назад

    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!

  • @user-jy5yh9on4l
    @user-jy5yh9on4l Год назад

    Большое спасибо, добрый человек

  • @SlurpCode
    @SlurpCode Год назад

    I choose the same default build task however my args structure is different, is this normal and do I need to change it?

  • @ww25_td
    @ww25_td Год назад

    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?

  • @minanaji9597
    @minanaji9597 Год назад

    Works on M1 macbook! Thanks!

  • @nunzioturtulici9636
    @nunzioturtulici9636 Год назад

    I wanna say thank you! I would gone crazy trying to set up all without your video...thanks for sharing!

  • @Sony_MiniDisc
    @Sony_MiniDisc Год назад

    I love indian programming tutorials

  • @user-jj5df5yc1p
    @user-jj5df5yc1p Год назад

    anyone else have the issue of not being able to open the source code for the header file?

    • @gamerxl369
      @gamerxl369 Год назад

      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

  • @user-jj5df5yc1p
    @user-jj5df5yc1p Год назад

    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

  • @user-jj5df5yc1p
    @user-jj5df5yc1p Год назад

    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??

  • @sanghamitradas9437
    @sanghamitradas9437 Год назад

    Hey. Mine is stuck at "Starting build..." for over 15mins now. Do you have any clue why? No other errors.

  • @wilchardruin
    @wilchardruin Год назад

    it's a great begin , thanks

  • @sheldonxu635
    @sheldonxu635 Год назад

    i made a mistake creating the main.cpp under the dependancy folder, im so dumbbb

  • @rylee5233
    @rylee5233 Год назад

    Thank you !Thats is really helpful and clear

  • @rylee5233
    @rylee5233 Год назад

    I cant start build after using conmand shift B ....what happened?or is there any other way to build?

    • @rylee5233
      @rylee5233 Год назад

      OK I found it in just under Terminal

  • @sandeep.p7
    @sandeep.p7 Год назад

    How to run the code after "build run sucessfully"

    • @rosxnb
      @rosxnb Год назад

      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" }

  • @luckysun1852
    @luckysun1852 Год назад

    amazing videos, you saved my life.