I've been following along by recreating the project in Visual Studio 2022. It took a little while before I figured out how to set the language to C++23 but after that everything worked fine including the debug information in the stacktrace. It might be worth checking out the default config you get when you create a new CMake project in Visual Studio and comparing it to what you're doing.
Essential information missing: What compiler are you using (VS can use several!)? What is the version of your compiler? What are the options used? What kind of Subsystem and so on ... :) It's important, because std::stacktrace is cutting edge, non production ready tech. Also it may be compiler dependent AND is implemented in the STL. For example, see: STL/issues/1447 "P0881R7 " and cppreference, topic "compiler_support/23": Stacktrace library = MSVC STL 19.34, meaning VS2022 17.4 onwards. GCC 12 has partial support and 14 requires linking against "-lstdc++exp". Others lack implementation, yet.
@dieSpinnt I don't even know enough to know what compiler I'm using. I just used the project structure given when starting a new CMake project after changing the CXX version to 23.
i think this video is a prime example on how abusing oop doesnt solve anything, but makes things overly complicated for no reason. no hate, but things can be much simpler :D
Really, is it so effing hard to give concrete directions? Under the cppreference page "basic_stacktrace" (Which Nathan had open), navigate to the "Example" section. First line shows links to msvc and gcc. On the msvc COMPILER EXPLORER (Matt Godbolt ... is the NAME of the creator) example, x64 msvc 19.latest (11. November 2024) is used as a compiler with "/std:c++latest /Z7" options. No offense, you don't seem to be a native speaker (I'm not either), but is it too much to ask that you at least provide correct information that makes sense? In no language in the world would your sentence structure and the incorrect information you provide make any sense. You wanted to help people and share your knowledge, am I correct? So you should check the correctness of your information beforehand, to see if it works... or can work at all!!! (Google would be enough. If you type your comment in there... you could spend hours searching helplessly). Anyway, this is once again a good example of how "well-intentioned" is usually just poorly executed, or laziness. But thank you, for your "secret" discovery:) Also, on my hour long search and thanks to Johnny (thanks again ...) I discovered many bugs and problems with the stacktrace implementation and visualizer of MSVC. This feature may not be production, or even nerd-tryout ready at this time and in no way safe for platform independent use. See stackoverflow topics like "MSVC 2022 Template Build Errors No Compile-Time Strack Trace?"; CppInsights Issue 188, "Crash with stack trace, trying to get insight about std::tuple"; stackoverflow "Is it possible to obtain a stack trace on Windows without PDB files present? If yes, how?" and so on ... There are also alternatives, like Cpptrace ("Cpptrace is a simple and portable C++ stacktrace library supporting C++11 and greater on Linux, macOS, and Windows including MinGW and Cygwin environments. The goal: Make stack traces simple for once."), which to use is not the goal of Nathan in this project, but his "The Life and Times of Grizzly Adams" (movie series about a man living in a log cabin alone in the wilderness and is self-sufficient, from the 1977-1978) approach, hehehe.
Yeah, good idea, Chris! How about a -repository with your config preferences and plugins for nvim. ... for us lazy folks? Thanks in advance, @nathanbaggs!:)
You shouldn't actually need to copy the compile_commands to the top level directory. Clangd should pick it up when it's in build. At least does for me. Also you can use -Bbuild to be able to configure from the top level directory into the build folder. Then you just run cmake --build build.
Interesting, it’s just something I’ve always done automatically but will give it a try. Also good tip for the build, again I’ve just always had a separate window in the build dir
I have a flick through this as I was interested to how you would have done it compared to how I've done this in my own OpenGL code. I essentially wrapped the GLFW commands in my own Window object so I could manage the runtime and used a deleter on a shared pointer. I was initially confused why you were handling this yourself but it appear to be something windows specific. Win 32 style APIs I find very confusing coming from a C#/Java background and I just avoid them when doing any C++ stuff and use the cross platform stuff. So I would be interested in how you are going to handle that. The Cherno has his own OpenGL tutorials and what I found was that it mismatched with how OpenGL worked (especially on how he was handing Index Buffers). So I am interested in how you handle that.
unique_ptr models a pointer which is subtly different to what I want. For example I don’t want operator-> and I want a custom invalid value (can’t assume nullptr is invalid for all types)
I hope this helps, templates is just a tool that can make code that has a specific task more generic. for example if you have a function that prints integers you will have to pass in only integers but if you use a template you can pass in floats and strings etc. as well
@@Digitalgems9000 That may seem that way if you have not worked with templates a lot. Templates are a strong tool if you understand how to work with them. But i do think most people overdo it with them, im at 29:00 and i already think this project will be template hell. Just try to use templates more often in your projects. Start with small things and work your way up. And if you feel confident, try templated classes and inheritance with template classes, there is much to learn from this
Learn Generics in C#/Typescript/Python or something similar and then come back to C++ as it makes a lot more sense. Pointers in Go, helped me to understand pointers in C++.
@@justshinigami9364 I have to watch this fully one evening, but just flicking through and looking at the code he is making it a bit too complicated. I wouldn't have bothered. Then again I am not as good as C++ as he is.
Windows NT -> WSL -> Wine -> Microsoft C/C++ Optimizing Compiler? Um okay… why not use the compiler under Windows, using NeoVim for Windows, using CMake for Windows, using Clangd for Windows? I know you’d have to manually download dependencies or whatever but it would probably be more convenient. Or you could do all that and utilize MinGW-w64 for in-terminal debugging (gdb) without the hassle of getting LLDB to run properly with PDB files. If you’re looking for a Linux-portable setup, WSL is a bit better than a VM because of GPU support, but not as good as a dual-boot or a separate machine. WSL should be alright for graphics programming though, as WSL comes with Wayland/X Windows support. I stopped @ 17:26 by the way, maybe you’ll explain it later.
I've been following along by recreating the project in Visual Studio 2022. It took a little while before I figured out how to set the language to C++23 but after that everything worked fine including the debug information in the stacktrace. It might be worth checking out the default config you get when you create a new CMake project in Visual Studio and comparing it to what you're doing.
Essential information missing: What compiler are you using (VS can use several!)? What is the version of your compiler? What are the options used? What kind of Subsystem and so on ... :)
It's important, because std::stacktrace is cutting edge, non production ready tech. Also it may be compiler dependent AND is implemented in the STL. For example, see: STL/issues/1447 "P0881R7 " and cppreference, topic "compiler_support/23": Stacktrace library = MSVC STL 19.34, meaning VS2022 17.4 onwards. GCC 12 has partial support and 14 requires linking against "-lstdc++exp". Others lack implementation, yet.
@dieSpinnt I don't even know enough to know what compiler I'm using. I just used the project structure given when starting a new CMake project after changing the CXX version to 23.
Nice you’re following along! Going to have a play around and see if I can get it working
i think this video is a prime example on how abusing oop doesnt solve anything, but makes things overly complicated for no reason. no hate, but things can be much simpler :D
At this point we’re only really using objects for RAII
I've seen people complain about OOP but such people rarely seem to even understand what OOP is or have any credentials to back up what they're saying
Ooh I'm pretty excited for this
Do you do any personal tutoring?
/Z7 there is a godbolt exemple on stack trace page
Doesn't work - I suspect some sort of discrepancy with wine msvc
Really, is it so effing hard to give concrete directions?
Under the cppreference page "basic_stacktrace" (Which Nathan had open), navigate to the "Example" section. First line shows links to msvc and gcc. On the msvc COMPILER EXPLORER (Matt Godbolt ... is the NAME of the creator) example, x64 msvc 19.latest (11. November 2024) is used as a compiler with "/std:c++latest /Z7" options.
No offense, you don't seem to be a native speaker (I'm not either), but is it too much to ask that you at least provide correct information that makes sense? In no language in the world would your sentence structure and the incorrect information you provide make any sense. You wanted to help people and share your knowledge, am I correct? So you should check the correctness of your information beforehand, to see if it works... or can work at all!!! (Google would be enough. If you type your comment in there... you could spend hours searching helplessly).
Anyway, this is once again a good example of how "well-intentioned" is usually just poorly executed, or laziness. But thank you, for your "secret" discovery:)
Also, on my hour long search and thanks to Johnny (thanks again ...) I discovered many bugs and problems with the stacktrace implementation and visualizer of MSVC. This feature may not be production, or even nerd-tryout ready at this time and in no way safe for platform independent use. See stackoverflow topics like "MSVC 2022 Template Build Errors No Compile-Time Strack Trace?"; CppInsights Issue 188, "Crash with stack trace, trying to get insight about std::tuple"; stackoverflow "Is it possible to obtain a stack trace on Windows without PDB files present? If yes, how?" and so on ...
There are also alternatives, like Cpptrace ("Cpptrace is a simple and portable C++ stacktrace library supporting C++11 and greater on Linux, macOS, and Windows including MinGW and Cygwin environments. The goal: Make stack traces simple for once."), which to use is not the goal of Nathan in this project, but his "The Life and Times of Grizzly Adams" (movie series about a man living in a log cabin alone in the wilderness and is self-sufficient, from the 1977-1978) approach, hehehe.
Looking forward to the next streams
@Nathan is it possible to share your nvim setup to work with c++ ?
Yeah, good idea, Chris! How about a -repository with your config preferences and plugins for nvim.
... for us lazy folks?
Thanks in advance, @nathanbaggs!:)
github.com/nathan-baggs/kickstart.nvim
You shouldn't actually need to copy the compile_commands to the top level directory. Clangd should pick it up when it's in build. At least does for me. Also you can use -Bbuild to be able to configure from the top level directory into the build folder. Then you just run cmake --build build.
Interesting, it’s just something I’ve always done automatically but will give it a try. Also good tip for the build, again I’ve just always had a separate window in the build dir
I have a flick through this as I was interested to how you would have done it compared to how I've done this in my own OpenGL code. I essentially wrapped the GLFW commands in my own Window object so I could manage the runtime and used a deleter on a shared pointer. I was initially confused why you were handling this yourself but it appear to be something windows specific.
Win 32 style APIs I find very confusing coming from a C#/Java background and I just avoid them when doing any C++ stuff and use the cross platform stuff. So I would be interested in how you are going to handle that.
The Cherno has his own OpenGL tutorials and what I found was that it mismatched with how OpenGL worked (especially on how he was handing Index Buffers). So I am interested in how you handle that.
Cherno was doing things in a way that compatible with multiple rendering API.
@@AllExistence Not on his OpenGL tutorials he wasn't. What he did didn't actually make sense at in a few places.
Stream was fire🔥🔥🔥
Check one thing for me please - in default constructor of AutoRelease, what value should you pass for T ? {} or Invalid?
Good spot. It’s still works as the dtor is empty, but will change it to make it clearer
1:56
What about std::unique_ptr instead of AutoRelease?
unique_ptr models a pointer which is subtly different to what I want. For example I don’t want operator-> and I want a custom invalid value (can’t assume nullptr is invalid for all types)
i will never understand templates i just never will i think. my brain can't comprehend em LOL. iuno how you do it. one smart cookie for sure
I hope this helps, templates is just a tool that can make code that has a specific task more generic. for example if you have a function that prints integers you will have to pass in only integers but if you use a template you can pass in floats and strings etc. as well
@@chrisnevermorebotha3040 i see yeah. my brain just gets lost at the different types being passed in there iuno how to explain LOL
@@Digitalgems9000 That may seem that way if you have not worked with templates a lot. Templates are a strong tool if you understand how to work with them. But i do think most people overdo it with them, im at 29:00 and i already think this project will be template hell. Just try to use templates more often in your projects. Start with small things and work your way up. And if you feel confident, try templated classes and inheritance with template classes, there is much to learn from this
Learn Generics in C#/Typescript/Python or something similar and then come back to C++ as it makes a lot more sense. Pointers in Go, helped me to understand pointers in C++.
@@justshinigami9364 I have to watch this fully one evening, but just flicking through and looking at the code he is making it a bit too complicated. I wouldn't have bothered. Then again I am not as good as C++ as he is.
Windows NT -> WSL -> Wine -> Microsoft C/C++ Optimizing Compiler? Um okay… why not use the compiler under Windows, using NeoVim for Windows, using CMake for Windows, using Clangd for Windows? I know you’d have to manually download dependencies or whatever but it would probably be more convenient. Or you could do all that and utilize MinGW-w64 for in-terminal debugging (gdb) without the hassle of getting LLDB to run properly with PDB files. If you’re looking for a Linux-portable setup, WSL is a bit better than a VM because of GPU support, but not as good as a dual-boot or a separate machine. WSL should be alright for graphics programming though, as WSL comes with Wayland/X Windows support. I stopped @ 17:26 by the way, maybe you’ll explain it later.
1.47.01 Scooby-Doo laugh
whats the font ?
Fira code