Comment by HolyBlackCat on Is it possible to install msys2 in windows 7
@user213769 Because SO has gotten better, and Codidact is mostly dead (barely any questions in my area of expertise).
View ArticleComment by HolyBlackCat on How can I set range to the random library
@VladimirRoblesBykbaev In C++20 and newer you don't need to specify the value type for uniform_int_distribution.
View ArticleComment by HolyBlackCat on How to use index sequence to unroll for loops?
Don't forget to measure performance before and after, with optimizations enabled.
View ArticleComment by HolyBlackCat on Initializing a std::string_view with a C-style...
String literals permanently exist in a fixed memory location while the program is running, regardless of string_view.
View ArticleComment by HolyBlackCat on How to limit the objects in a window with a screen...
A minimal reproducible example is needed.
View ArticleComment by HolyBlackCat on Can not find -lSDL2 and -lSDL2main when trying to...
Instead of installing SDL2 manually, install from MSYS2: pacman -S mingw-w64-ucrt-x86_64-SDL2.
View ArticleComment by HolyBlackCat on Why does my simple C++ program with shared_ptr...
std::shared<char>(new char[100]) would then use delete instead of delete[], which is UB.
View ArticleComment by HolyBlackCat on Clang LibTooling doesn't process any source files
Ahh, so I made a typo when copying from a tutorial, ASTFrontendAction vs FrontendAction. Will try it tomorrow and report back.
View ArticleClang LibTooling doesn't process any source files
I'm trying to run a minimal LibTooling example, but must be missing something obvious, because my AST visitor isn't getting called at all, and any errors in the input files aren't getting...
View ArticleComment by HolyBlackCat on Is it possible to install MSYS2 on Windows 7?
@user213769 Because SO has gotten better, and Codidact is mostly dead (barely any questions in my area of expertise).
View ArticleComment by HolyBlackCat on man make for a most simple Makefile to be written
"What Makefile shall I write that linux man make may inspire to Windows user as simple as '-' ?" I don't understand this sentence at all.
View ArticleComment by HolyBlackCat on Specialisation of std::hash with template parameters
Please make a minimal reproducible example. We want a single piece of code (without includes removed, etc), that we can paste into an IDE and see the same error you do.
View ArticleComment by HolyBlackCat on Not needing constexpr after else if
The two snippets are not equivalent. You were able to drop the second constexpr because the last branch is valid even if the condition is true.
View ArticleAnswer by HolyBlackCat for expand parameter pack with boolean operation
Fold expressions must be enclosed in (...): return ((ts == value) || ... || (false));.Also you can drop || false, it's implicit for || folds.Also I would like to get rid of specifying the type if...
View ArticleComment by HolyBlackCat on Cross-compiling with VS code on Mac for Windows VM
(2) can be done in two ways. Either you find a version of MinGW for Mac (I'm not a Mac user, so no idea where to get it) (which will include both some executables, and headers/libraries), OR you find...
View ArticleComment by HolyBlackCat on collect2.exe: error: ld returned 116 exit status
For starters, what are the contents of compile_log2.txt?
View ArticleComment by HolyBlackCat on Can't Link with Provided DLL
Just follow your tutorial. You don't need to generate the import library for SDL2, it should already be included in the build of SDL2 you've downloaded. Also linking just SDL2 is not enough on Windows,...
View ArticleComment by HolyBlackCat on Does MinGW-w64 source code need to be...
You likely don't need an existing MinGW installation when building on Linux. But you do need a linux compiler, binutils, etc (so your title doesn't match the question?). You'd only need existing MinGW...
View ArticleComment by HolyBlackCat on I am new to c++ and I can't get started
Forget the endless jsons, compile directly in the terminal first. Once you figure that out, learn how to run the same compilation command from VSC. (Hint: you're misusing launch.json. That's for when...
View ArticleComment by HolyBlackCat on Can not compile source using std
--needed shouldn't change anything. The flag just prevents the packages from getting reinstalled if they are already installed (perhaps you somehow corrupted the installation before...).
View Article