Linking VS 2015 build dll to a VS 2012 application - c++

I have linked set of dll's which are built using visual studio 2015 to a Visual Studio 2012 application, strangely I haven't seen any linker issues and I am able to execute the API's provided by those dll's.
Will there be any problem with this approach? Why I haven't got binary compatibility problem ?

Related

Python source compile in windows

By default Python 3.3 installers are built with Visual studio 2010.
I have visual studio 2013 and I want to generate the python33.dll from visual studio 2013.
When i link my application with dll generated from visual studio 2013 then it is getting crash in "Py_Initialize" function but when i link my application with dll generated from visual studio 2010 then everything works fine.
I have tried to build from source with VS2013. Going into "PCBuild" folder and try to build Python33.dll from .sln file but application is getting crashed.
How to make application run without crash with visual studio 2013 dll ?
Is there any steps to compile the Python source code in MinGW in windows ?
Thanks in Advance

Is it possible to have VS2010 and VS2012 projects concurrently on the same source code

I have a VS2010 library project that I would like to use in a new app in VS2012. Of course when I open VS2012 it wants to update the library project. Is there any way of having two projects - one for VS2010 and one for VS2012?
We have a large product portfolio and not all apps will move to VS2012 at the same time.
Generally, as long as you're running VS2010 SP1, everything will work appropriately opening the project with both versions of VS.
For C++ compatibility specifically:
You can use Visual Studio 2012 to open a C++ project that was created in Visual Studio 2010 SP1. If you want to use the Visual Studio 2012 build environment to build a project that was created in Visual Studio 2010 SP1, you must have both versions of Visual Studio installed on the same computer.
The full list of compatibility information can be found on msdn

Compile in Visual Studio 2013 for Visual Studio 2010 Redistributables

I have installed MS VS Express 2013 on my office computer, and compiled a DLL with it. Now when my colleague is trying to use it, she gets an error about a missing MSVCR120.DLL. We have found MSVCR100.DLL on her PC. I know that we can get MSVCR120.DLL from Microsoft. However
it will probably require admin rights, and only I have them in our team. I wonder if I can ask VS 2013 to compile the DLL so that it uses older version of redistributables? Or is installing the previous version of VS the only solution?
I found the solution — here: https://stackoverflow.com/a/1073772/674976. The distributable DLL can be statically linked to my DLL, thus removing the dependence. This is done in VS 2013 in Project Properties (Alt + F7) > Configuration Properties > C/C++ > Code Generation > Runtime Library, which should be set to Multi-threaded (/MT) from the default Multi-threaded DLL (/MD).
However, I wonder if by doing so I am actually still using redistributable DLLs of two versions and thus risk mixing the heaps and potentially causing memory allocation problems.
If someone suggests a better solution or a clear explanation why I should simply use Visual Studio 2010, I'll be happy to accept it is an answer.
Visual Studio 2013 can build Visual Studio 2010 C++ projects. To do this, you need to also have Visual Studio 2010 installed, because VS2013 will actually call the VS2010 C++ compiler.
What I have done to accomplish this is to create the solution and all the projects in Visual Studio 2010 and make sure that they build and run correctly. Then open them in Visual Studio 2013 and make sure to NOT upgrade the projects to VS2013.
Now you can use the latest tool and still build the VS2010 dlls that you need.

MSVCP120d.dll missing

Every time I want to compile my Visual Studio project I get the message that MSVCP120d.dll is missing. Google can't help me. I already installed some redistributables but they didn't help. I also found this:
Msvcp120d.dll Debug version of C++ runtime. No redistribution
allowed.
http://msdn.microsoft.com/en-us/library/windows/hardware/dn448963(v=vs.85).aspx
From the comments, the problem was caused by using dlls that were built with Visual Studio 2013 in a project compiled with Visual Studio 2012. The reason for this was a third party library named the folders containing the dlls vc11, vc12. One has to be careful with any system that uses the compiler version (less than 4 digits) since this does not match the version of Visual Studio (except for Visual Studio 2010).
vc8 = Visual Studio 2005
vc9 = Visual Studio 2008
vc10 = Visual Studio 2010
vc11 = Visual Studio 2012
vc12 = Visual Studio 2013
vc14 = Visual Studio 2015
vc15 = Visual Studio 2017
vc16 = Visual Studio 2019
The Microsoft C++ runtime dlls use a 2 or 3 digit code also based on the compiler version not the version of Visual Studio.
MSVCP80.DLL is from Visual Studio 2005
MSVCP90.DLL is from Visual Studio 2008
MSVCP100.DLL is from Visual Studio 2010
MSVCP110.DLL is from Visual Studio 2012
MSVCP120.DLL is from Visual Studio 2013
MSVCP140.DLL is from Visual Studio 2015, 2017 and 2019
There is binary compatibility between Visual Studio 2015, 2017 and 2019.
I have found myself wasting time searching for a solution on this, and i suspect doing it again in future. So here's a note to myself and others who might find this useful.
If MSVCP120.DLL is missing, that means you have not installed Visual C++ Redistributable Packages for Visual Studio 2013 (x86 and x64). Install that, restart and you should find this file in c:\Windows\System32 .
Now if MSVCP120D.DLL is missing, this means that the application you are trying to run is built in Debug mode. As OP has mentioned, the debug version of the runtime is NOT distributable.
So what do we do?
Well, there is one option that I know of: Go to your Project's Debug configuration > C/C++ > Code Generation > Runtime Library and select Multi-threaded Debug (/MTd). This will statically link MSVCP120D.dll into your executable.
There is also a quick-fix if you just want to get something up quickly: Copy the MSVCP120D.DLL from sys32 (mine is C:\Windows\System32) folder. You may also need MSVCR120D.DLL.
Addendum to the quick fix: To reduce guesswork, you can use dependency walker. Open your application with dependency walker, and you'll see what dll files are needed.
For example, my recent application was built in Visual Studio 2015 (Windows 10 64-bit machine) and I am targeting it to a 32-bit Windows XP machine. Using dependency walker, my application (see screenshot) needs the following files:
opencv_*.dll <-- my own dll files (might also have dependency)
msvcp140d.dll <-- SysWOW64\msvcp140d.dll
kernel32.dll <-- SysWOW64\kernel32.dll
vcruntime140d.dll <-- SysWOW64\vcruntime140d.dll
ucrtbased.dll <-- SysWOW64\ucrtbased.dll
Aside from the opencv* files that I have built, I would also need to copy the system files from C:\Windows\SysWow64 (System32 for 32-bit).
You're welcome. :-)
I have the same problem with you when I implement OpenCV 2.4.11 on VS 2015.
I tried to solve this problem by three methods one by one but they didn't work:
download MSVCP120.DLL online and add it to windows path and OpenCV bin file path
install Visual C++ Redistributable Packages for Visual Studio 2013 both x86 and x86
adjust Debug mode. Go to configuration > C/C++ > Code Generation > Runtime Library and select Multi-threaded Debug (/MTd)
Finally I solved this problem by reinstalling VS2015 with selecting all the options that can be installed, it takes a lot space but it really works.
I downloaded msvcr120d.dll and msvcp120d.dll for 32-bit version and then, I put them into Debug folder of my project. It worked well. (My computer is 64-bit version)
My problem was with x64 compilations deployed to a remote testing machine. I found the x64 versions of msvp120d.dll and msvcr120d.dll in
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\Debug_NonRedist\x64\Microsoft.VC120.DebugCRT
I had the same problem in Visual Studio Pro 2017: missing MSVCP120.dll file in Release mode and missing MSVCP120d.dll file in Debug mode.
I installed Visual C++ Redistributable Packages for Visual Studio 2013 and Update for Visual C++ 2013 and Visual C++ Redistributable Package as suggested here Microsoft answer this fixed the release mode.
For the debug mode what eventually worked was to copy msvcp120d.dll and msvcr120d.dll from a different computer (with Visual studio 2013) into C:\Windows\System32
Alternate approach : without installation of Redistributable package.
Check out in some github for the relevant dll, some people upload the reference dll for their application dependency.
you can download and use them in your project , I have used and run them successfully.
example : https://github.com/Emotiv/community-sdk/find/master
I was building my application on VS 2019 when this issue came up. You can copy these DLLs from this location into debug directory of your application to get going.

SQLAPI++ in VS 2012

I am trying to use SQLapi library from inside Visual Studio 2012 x64 but SQLapi does not have lib & dll.
Of Visual Studio 2012 so I used older version from Visual Studio 2010 dll and lib.
First I got an error msvcr100d.dll not found (I think it is for Visual Studio 2010) even for Visual Studio 2010 x64.
Redistributal is installed, and I added to debug a folder manually, then I ran the program, I got another error.
The application was unable to start correctly (0xc000007b). Click OK to close the application.
This may have been due to debug mode so I changed it to release mode but I got 22 linker errors what is wrong? I am not getting the exact problem.
Thanks in advance.
This problem is solved by SQLAPI team in newer version.