Difference in performance between MSVC and GCC for highly optimized matrix multplication code

Since we’ve covered the alignment issue, I would guess it’s this: http://en.wikipedia.org/wiki/Out-of-order_execution Since g++ issues a standalone load instruction, your processor can reorder the instructions to be pre-fetching the next data that will be needed while also adding and multiplying. MSVC throwing a pointer at mul makes the load and mul tied to the same … Read more

Using C# dll in C++ code

There are basically two cases to call a .NET DLL from unmanaged code: The .NET DLL exposes a COM interface. In this case, you can use COM from your C++ code. The .NET DLL does not expose a COM interface. In this case, you have two possibilities (to make it simple): 2.a. host the CLR … Read more

warning MSB8012 : make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile)

Did you upgrade a project to Visual Studio 2010 from a previous version? If so, this is a well-known issue. Visual Studio 2010 C++ Project Upgrade Guide http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx Warnings during upgrade Here are some of the common warnings that you may run into during conversion: 1) Linker output directory One of the warnings you may … Read more

What are the different calling conventions in C/C++ and what do each mean?

Simple answer: I use cdecl, stdcall, and fastcall. I seldom use fastcall. stdcall is used to call Windows API functions. Detailed answer (Stolen from Wikipedia): cdecl – In cdecl, subroutine arguments are passed on the stack. Integer values and memory addresses are returned in the EAX register, floating point values in the ST0 x87 register. … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)