↧
Comment by HolyBlackCat on Why some of my loop is being skipped? C++
Please add your code as text to the question itself, and strip all unnecessary stuff from it (read about minimal reproducible example).
View ArticleComment by HolyBlackCat on How do you draw graphics in C/C++ without external...
Your best bet is a cross-platform library such as SDL, SFML, Raylib.
View ArticleComment by HolyBlackCat on GCC 14 update, operator= now complains about a...
Const and reference members are evil for this exact reason. Can you produce a minimal reproducible example that compiles on GCC 13 but not 14?
View ArticleComment by HolyBlackCat on c - error: invalid operands to binary * (have...
Why did you accept an answer to the previous question if it doesn't actually work? Re-read your tutorial. You need SDL_Window *foo = SDL_CreateWindow(...);, where SDL_Window* is the type of a variable,...
View ArticleAnswer by HolyBlackCat for Why the compiler tries to call A(int) to construct...
error: new initializer expression list treated as compound expression [-fpermissive]This means:I could interpret the , as an operator, but that's illegal in this context, so I won't unless you pass...
View ArticleComment by HolyBlackCat on which package to choose from msys2?
@FelixFXu Did you read What are MSYS2 environments? How do I pick one?
View ArticleComment by HolyBlackCat on How to find an element in a vector of class...
@tadm123 (1) You could also create a class with overloaded operator(), with myWord as a member variable. That's what a lambda expands to. (2) No, because std::find_if calls the lambda with a single...
View ArticleComment by HolyBlackCat on MSYS2 on Windows 10 - cannot update the package...
No, the two are equivalent (and it's the first time I see the latter spelling). In general, all small letters after the first capital one are order-independent, I believe.
View ArticleComment by HolyBlackCat on How is Numpy able to get an array size at run-time?
You want std::vector rather than a raw array, it can have its size set at runtime. (Uses new[] under the hood to achieve that.) It would also be a nice idea to use something like std::mdspan as your...
View ArticleComment by HolyBlackCat on Using precompiled header with dependency generation
Hot take: Clang doesn't understand this style of PCHs (automatically picking up PCHs for an #include), the only thing it supports and the only common style it and GCC support is picking it up via an...
View ArticleComment by HolyBlackCat on SDL_Image Fails to Run, Exiting with Code 1
Try double-clicking the .exe in the explorer, see if it shows any error message.
View ArticleComment by HolyBlackCat on std::println/print not working in Winlibs MinGW...
@SHIPWECK Works on my end (but with MSYS2 GCC). Are you sure you're adding this flag to the right of testing.cpp? -l have no effect when specified to the left of source/object files.
View ArticleComment by HolyBlackCat on How can I skip includes using libclang?
clang_Location_isFromMainFile always returned false for me for some reason, but comparing the filenames worked.
View ArticleComment by HolyBlackCat on Determine whether a class has a member function...
You make a helper class that inherits from Foo and contains its own something() and using Foo::something;, and then check if &Derived::somethinig is well-formed (if it is, then Foo had no...
View ArticleAnswer by HolyBlackCat for Why is low-level const of a reference not deduced?
Because it just... makes sense?You don't want to strip non-top-level constness from a pointer/reference because that would be unsafe (potentially letting you modify a const object, which is UB).But...
View ArticleAnswer by HolyBlackCat for lldb error: Cannot launch a.out: personality set...
personality set failed: Operation not permittedI had this error when trying to use LLDB in Docker. The cryptic error means it tries to disable ASLR and fails at it (GDB also tries and fails, but it...
View ArticleComment by HolyBlackCat on Compiler wrongfully regards variable as rvalue
Yes, looks like a bug.
View ArticleComment by HolyBlackCat on Insert contents of a vector into another vector at...
@Schweini Why is it troublesome? Isn't it just the max of offset[i] + size[i] across all fragments? Or if there's no easy way to list fragments in advance, you could resize on every iteration, before...
View ArticleComment by HolyBlackCat on Measure execution time between 2 breakpoints in...
Anything you find is going to be language-specific, since each language has its own debugger plugin.
View ArticleComment by HolyBlackCat on How do I run an MSys2 shell to block until command...
@Rainb OP used mingw32.exe, so I just copied the same environment. Do you have any sources for it being EOL?
View Article
More Pages to Explore .....