Python, installing clarifai –> VS14.0 link.exe failed with exit status 1158

I had a similar problem today, and I solved it referring to Visual Studio can’t build due to rc.exe. To fix the issue, do next steps: Add this to your PATH environment variables: C:\Program Files (x86)\Windows Kits\10\bin\x64 Copy these files rc.exe & rcdll.dll from C:\Program Files (x86)\Windows Kits\8.1\bin\x86 to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin … Read more

Get memory address of member function?

There exists a syntax to get the address of the member function in MSVC (starting from MSVC 2005 IMHO). But it’s pretty tricky. Moreover, the obtained pointer is impossible to cast to other pointer type by conventional means. Though there exists a way to do this nevertheless. Here’s the example: // class declaration class MyClass … Read more

Purpose of stdafx.h [duplicate]

stdafx.h is a file, generated by Microsoft Visual Studio IDE wizards, that describes both standard system and project specific include files that are used frequently but hardly ever change. Compatible compilers (for example, Visual C++ 6.0 and newer) will pre-compile this file to reduce overall compile times. Visual C++ will not compile anything before the … Read more

What exactly is “broken” with Microsoft Visual C++’s two-phase template instantiation?

I’ll just copy an example from my “notebook” int foo(void*); template<typename T> struct S { S() { int i = foo(0); } // A standard-compliant compiler is supposed to // resolve the ‘foo(0)’ call here (i.e. early) and // bind it to ‘foo(void*)’ }; void foo(int); int main() { S<int> s; // VS2005 will resolve … Read more

How to override a virtual member function which has the same name in two base classes

This problem doesn’t come up very often. The solution I’m familiar with was designed by Doug McIlroy and appears in Bjarne Stroustrup’s books (presented in both Design & Evolution of C++ section 12.8 and The C++ Programming Language section 25.6). According to the discussion in Design & Evolution, there was a proposal to handle this … Read more

Ambiguous call to overloaded function taking int or float when passing a decimal number

Look at the error message from gcc: a.cpp:16: error: call of overloaded โ€˜function(double, double)โ€™ is ambiguous a.cpp:3: note: candidates are: void function(int, int) a.cpp:9: note: void function(float, float) A call to either function would require truncation, which is why neither is preferred over the other. I suspect you really want void function(double y,double w). Remember … Read more

Linking to MSVC DLL from MinGW

You can’t do this. They have exported C++ classes from their dll, rather than C-functions. The difference is, c++ functions are always exported with names in a mangled form that is specific to a particular version of the compiler. Their dll is usable by msvc only in that form, and will probably not even work … Read more