Quantcast
Channel: User HolyBlackCat - Stack Overflow
Browsing all 1285 articles
Browse latest View live
↧

Comment by HolyBlackCat on How to fix "mingw32-make: *** No rule to make...

Yeah, this is a completely invalid makefile. You need some tutorial on writing those.

View Article


Comment by HolyBlackCat on How to static link SDL library with gcc?

When linking libraries statically, you must also statically link all their dependencies. Try running pkgconf --libs --static sdl2, this should give you the correct flags (or pkg-config instead of...

View Article


Comment by HolyBlackCat on The registered function with...

You should tag your programming language too, for better visibility.

View Article

Comment by HolyBlackCat on System can't find libSDL3.so.0 at runtime?

Show the output from file libSDL3.so.0. Maybe it's a broken symlink?

View Article

Comment by HolyBlackCat on Post-target in Makefile

Make will never run a target more than once. I can instead recommend generating all your targets using foreach and eval, and using that to add common code to them.

View Article


Comment by HolyBlackCat on Why `std::plus` cannot call `operator+` for...

Operators should always be in namespaces where ADL can find them, otherwise they don't work reliably. This means that it's not possible to add operator overloads for std::vector<int>, since...

View Article

Comment by HolyBlackCat on fatal error: SDL.h: No such file or directory in...

...You're missing -Iinclude/SDL2, and all other compiler/linker flags needed to use SDL2. This is unrelated to makefiles. Also your stated directory structure doesn't match include/SDL2/SDL.h, where's...

View Article

Comment by HolyBlackCat on type alias dependent name in a derived class:...

Please always tag c++, not just c++XX alone. Also please don't add line numbers to code, we want to be able to copy-paste it.

View Article


Comment by HolyBlackCat on Compile time complexity (i.e run time complexity...

Last time I checked, you couldn't have tuples with more than 1-2k elements. Check how many elements your compiler can handle.

View Article


Comment by HolyBlackCat on type alias dependent name in a derived class:...

@user12002570 Are you saying that typedefs are not instantiated before the first use? Okay, but it works everywhere, not only in typedefs: gcc.godbolt.org/z/3noqYPGP7

View Article

Comment by HolyBlackCat on Workaround GCC bug to create an...

Everything else aside, not omitting includes is customary (and good manners). We don't want to add them every time we copypaste the code from a question to test it.

View Article

Comment by HolyBlackCat on Add missing includes without path

Never happened to me. We're going to need a minimal reproducible example (your directory structure, compile_commands.json and/or Clangd config, etc).

View Article

Comment by HolyBlackCat on Can someone explain the rules of object lifetimes...

You need to start lifetimes of individual array elements using placement-new (when resizing the vector), and destroy them when the vector dies (by manually calling the destructor).

View Article


Comment by HolyBlackCat on Syntactic sugar for timing a block of code in C++

@wohlstad Mhm, I don't think I'd use this myself either in this case.

View Article

Comment by HolyBlackCat on How do I go about resolving LNK2019 in C++ and SDL?

@463035818_is_not_an_ai I don't like that duplicate and am tempted to reopen this question. SDL is notoriously weird in its handling of main (does #define main ...) and what not, and I don't even know...

View Article


Comment by HolyBlackCat on std::make_unique and designated initializers

std::move isn't needed here.

View Article

Comment by HolyBlackCat on Convert string_view to char* and walk away with it

What's wrong with keeping that std::string as a long-term storage for the characters? Why do you want to copy them elsewhere?

View Article


Comment by HolyBlackCat on When will a global variable export to the executable?

@user12002570 Doesn't seem to be. The constructors are not called at all, not in the wrong order.

View Article

Comment by HolyBlackCat on how to declare string as variable stored inside...

This is not how C++ works. All variable names are fixed at compile-time, you can't use a runtime string as one. After a program is compiled, variable names disappear completely.

View Article

Comment by HolyBlackCat on clang unable to find libstdc++, but libc++ works

This is usually caused by having g++ of an older version than gcc. What does gcc --version say?

View Article
Browsing all 1285 articles
Browse latest View live