Getting C++ Hello World working on Windows (a comedy && tragedy)
Compiling Hello World
- Download Visual Studio Installer and install Visual Studio 2022
- Get vcpkg working and install SDL2 and get its basic hello world working
- Learn that the titlebar isn’t darkmode in SDL2 but automatically is in SDL3
- Learn that SDL3 was finally released and that it’s probably way better
- Look for quickjs on vcpkg and find that it’s not there
- Learn of the quickjs-ng fork and debate which one to use
- Download quickjs from either place and guess which files are sources
Getting key bindings working
- Try writing a few lines of code in Visual Studio for more than 3 minutes
- Realize it’s like learning emacs or vim all over again ughhhhhh no thanks
- Enable
Visual Studio Code
keymapping for Visual Studio and try that
- Rejoice for about 5 minutes and enjoy using VS as if it were VS Code
- Realize that about 50% of the keybindings do absolutely unrelated things
- Learn that comment-lines doesn’t work if the first line is whitespace
Visual Studio Code integration
- Give up on using Visual Studio entirely and install VS Code
- Find the tasks.json fix so you don’t have to open VS Code from dev-prompt
- Install the C++ and CMake extensions for VS Code
- Note that these extensions point out that Visual Studio is basically better
- Add a questionable launch.json to debug the exe that CMake auto-updates or something
Alternative: not using Visual Studio
- Uninstall Visual Studio from the Installer
- Install CMake from its installer on its website
- Install Clang/LLVM from its installer on its website
- Compile hello world and see that it can’t find iostream
- Download and install MSYS2
- Uninstall MSYS2 since it literally didn’t do anything to fix this
- Install Visual Studio Preview from the Installer by accident
- Uninstall VS Preview and install VS non-Preview
- Repeat steps 1-8 about 15 times for 2 or 3 hours with slight variations
Upgrading to Conan
- Find quickjs in Conan and learn that it’s fuller than vcpkg
- Download and install Conan and hope the default profile is fine
- Create a conanfile.txt and add SDL3 by copy/pasting from Conan’s site
- Run
conan install .
and see that it works but now Visual Studio doesn’t run
- Notice that VS’s F5 now only has
conan-release
and also it does nothing
Bonus: Using WSL2
- Install WSL2
- Restart your whole computer
- Install Ubuntu 24
- Run
sudo snap install cmake
and hesitantly add --classic
when it says to
- Find that Clang/LLVM 18 is supported
- Download clang/llvm 20 from the website
- Read the website’s instructions for how to install it
- Delete the 1gb file and give up
- Install gcc since it apparently has better C++23 support now anyway somehow?
This list is not complete. Please let me know if I missed anything.