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

Comment by HolyBlackCat on How to link a .lib library in Windows without...

.lib is for MSVC, GCC (which is what you're using) uses .a. You've got the wrong prebuilt OpenCV.

View Article


Comment by HolyBlackCat on How does a std::array of resizable...

std::array stores a fixed number of instances, in this case exactly 4 vectors. It doesn't matter that the vectors themselves are resizable.

View Article


Comment by HolyBlackCat on C++ Translation Unit Counter

I think you got it the other way around. The global variable must be non-static, and the function itself must be static.

View Article

Comment by HolyBlackCat on Making window background transparent

You want SDL_CreateShapedWindow.

View Article

Comment by HolyBlackCat on What happens if i mix c with c++ in a c++ script?

Obligatory nitpicking that <cstdio> is allowed to duplicate the contents in the global namespace, just like <stdio.h> is allowed to duplicate them in std, IIRC.

View Article


Comment by HolyBlackCat on Can a pointer to member function be used directly...

Pointers-to-members aren't pointers, despite the name. (E.g. std::is_pointer returns false on them.) Unlike pointers, they don't store just an address (pointers to data members typically store offsets).

View Article

Comment by HolyBlackCat on Why doesn't MSYS Bash evaluate windows exectuable...

If the answer is the same, does it really matter that the question is different? Even if we close yours as a dupe, it'll remain as a signpost for anyone who googles the same problem you have.

View Article

Comment by HolyBlackCat on Undefined reference to SDL_Init() when...

Can you build in verbose mode and show the linking command?

View Article


Answer by HolyBlackCat for Overload resolution through return type?

overload resolution doesn't take return type into accountThey mean that given several viable overloads, they are not disambiguated based on the return type (on whether it matches how the return value...

View Article


Comment by HolyBlackCat on MINGW32-MAKE: *** No rule to make target...

The rule of thumb is for writing sane cross-platform makefiles is to use forward slashes everywhere, and to make sure you're using sh as the shell rather than cmd (which should happen automatically as...

View Article

Comment by HolyBlackCat on how to make a linked list with template

Please read about the minimal reproducible example and edit your question to add one. (We're missing at least some headers and template <typename t> before the first line.) Also add the exact...

View Article

Comment by HolyBlackCat on Variadic macros with zero arguments

Making this a runtime comparison is a horrible idea. Use __VA_OPT__, such as in CAT(BLAH_, __VA_OPT__(1))(__VA_ARGS__), and define BLAH_ and BLAH_1 to the empty and non-empty cases respectively.

View Article

Comment by HolyBlackCat on How can I compile with only llvm?

I believe you shouldn't manually -isystem that directory. You should do -resource-dir=${TOOLCHAIN_LLVM_DIR}/lib/clang/${LLVM_VERSION‌​_MAJOR}. I'm surprised it didn't work for you out of the box...

View Article


Answer by HolyBlackCat for how to make a linked list with template

Always start by reading the first error message.error C2512: 'node': no appropriate default constructor availableThis isn't the first one. The complete error is:<source>(18): error C2641: cannot...

View Article

Answer by HolyBlackCat for Retrieve value out of "cascading ifs" fold expression

I'm surprised it wasn't suggested yet:template <typename ...Pairs> auto make_switch(Pairs ...ps){ return [=](int x) { int ret; ((x == ps.first && (void(ret = ps.second()), true)) || ...)...

View Article


Comment by HolyBlackCat on (SOLVED) MYSY2 Git will not let me type when I try...

Please don't add "solved" to the title or the solution to the question. Instead post an "answer" below and click a checkmark next to it to mark your question as solved.

View Article

Comment by HolyBlackCat on How can there be no begin()/end() for...

If you read the manual for ranged-for, it accepts both x.begin() and begin(x). Also directory_iterator weirdly merges the iterator and the range itself into one class (that's why begin returns it...

View Article


Comment by HolyBlackCat on How can I get a batch script to keep an Msys2...

I'm curious why you need this. I understand wanting to open just bash at a specific directory (-where ... without -c ... solves that), but why would one want to open some other executable and keep bash...

View Article

Comment by HolyBlackCat on MYSY2 Git will not let me type when I try to enter...

Please don't add "solved" to the title or the solution to the question. Instead post an "answer" below and click a checkmark next to it to mark your question as solved.

View Article

Comment by HolyBlackCat on Render multiple pixels in SDL2 C

Yes, you should use a surface and store everything in it directly. Don't copy all pixels every frame.

View Article
Browsing all 1313 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>