mfc120.dll missing for an application built in VS2013 - visual-studio-2013

I have a VC++ based application developed in VS2010 which uses some of the win32 component. I ported the code in VS2013 and I built the code after removing all compilation error in Release Mode. Now when I am trying to run the exe in Computer where VS2013 is installed it is working fine where as it is giving an error of mfc120.dll is missing where only VS2010 is installed. I don't think after building the code in Release mode I should get an error of missing dll. I have not tried to run the exe where no Visual Studio is installed.

If you are using the DLL version of the MFC you also need to install the corresponding VS-2013 runtime DLLs vsredist_x86
Or you switch to a complete static build.

I have found out the solution for this problem. Basically the win32 code I was building was using the Configuration Properties->General-> 'Use MFC in a Shared DLL' which I changed to 'Use MFC in a Shared DLL'. All working fine there after

Related

dll library with cpprestsdk compilation on windows xp

I have dll project using cpprestsdk in visual studio 2019 (along with console application for testing purposes).
On windows 7 and windows 10 original package works as expected, however I'm having hard time to compile and run on windows XP.
cpprestsdk is included in the project through NuGet, version: cpprestsdk.v141 but, its not visible for the compiler. Line #include <cpprest/http_client.h> throws an error.
Changes i've made:
platform toolset set to Visual Studio 2017 - Windows XP (v141_xp)
preprocessor definitions updated to include CPPREST_TARGET_XP
statically included cpprest141_2_10.dll
statically linked cpprest141_2_10.lib
console application setting ConformanceMode set to false
Now the app is compiling, but it's not working properly on windows 10 (crashes on sending request). and it's not starting on windows XP (dll entry point not found)
Any1 have any idea what's going on?
#edit:
after adding to program folder missing dlls:
api-ms-win-core-crt-l1-1-0.dll
api-ms-win-core-crt-l2-1-0.dll
httpapi.dll
it came to ntdll.dll
Entry Point Not Found error screenshot
The procedure entry point WinSqmAddToStreamEx could not be located in the dynamic link library ntdll.dll
all you need to do is downgrade your Visual studio to 2013 and donwload the version of cpprest SDK like 2.9.1 which support the VS 2013 (msvc 120) as well, hope it helps

Deploy mixed code Visual Studio application

I have a problem running my application on other machines.
I am developing with Visual Studio 2008 in a Win7 x64 machine.
The solution contains several C# projects (the main application is written in C#, all others are library projects) and two c++/CLI libraries. The C++ libraries are Win32 and all C# projects are set to x86 target processor. No third party libraries used. Framework used is v3.5.
The application builds and runs fine on my machine.
I copied the whole "bin\release" folder to a Win7 x86 machine and it ran fine, too.
But when I tried on a XP x86 system, it did not start. No error message, not even showing up shortly in the task manager. The XP system has all updates installed, all available .NET frameworks installed and all Visual Studio Runtimes installed.
I checked with DependencyWalker and the only missing dlls are "IEShim.dll" and "wer.dll" which are only for Vista or higher.
I tried another of my applications that's not using C++ libraries and they work fine. So I guess I am doing something wrong deploying the C++ dlls.
Registering the C++ dlls with "regsvr32" failed with a "DllEntryPoint" not found message. Registering with "regasm" was successful, but had no effect.
What is it that I am missing?
Well, seems like I was a bit hasty stating "no third party components".
Actually it was the SQL Server Compact who was missing its runtime.

Crystaldecisions.CrystalReports.Engine.dll not found on client computer

I wrote a .NET DLL that uses a ReportViewer in VS2010. On the development computer, it works well. However, when I install the program on a client, I get the error message that Crystaldecisions.CrystalReports.Engine.dll is not found.
I installed both the .NET 4 framework and the 32-bit runtime MSI that SAP provides as a free download.
What else do I need to do to get this to work?
Did you download the runtime from the website below?
http://scn.sap.com/docs/DOC-7824
Maybe on the project setting -> reference, you can try to set to copy the dll to local and see if it works...

C++/CLI Missing MSVCR90.DLL

I have a c++/cli dll that I load at runtime and which works great in debug mode. If I try and load the dll in release mode it fails to load stating that one or more dependencies are missing. If I run depends against it I am missing MSVCR90.DLL from MSVCM90.DLL. If I check the debug version of the dll it also has the missing dependency, but against the debug (D) version.
I have made sure debug/release embed the manifest file. I read something about there being issues with the app loading the dll being build as Any CPU and the dll being built as x86, but I don't see how to set them both to x86.
I am using VS2010.
Anyway, I've been messing around for a while now and have no idea what is wrong. I'm sure someone out there knows what is going on. Let me know if I need to include additional info.
alt text http://www.freeimagehosting.net/uploads/fb31c0e256.png
UPDATE:
This ended up being the resolution to my problem: http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/07794679-159b-4363-ae94-a68fe258d827
MSVCR90 is the runtime for Visual Studio 2008. If you are running your application on your development PC, then you should have the debug and release runtimes installed (as part of Visual Studio) but it is possible something has gone awry with your install, or that VS2010 doesn't actually include the older runtimes. If you're trying to run the Release on a different PC, then it just needs the runtime installed.
Either way, you may be able to fix it by installing the Visual Studio 2008 redistributable - but make sure you get the right download for your PC (x86 or x64).
In previous versions of VS, you needed the runtime for the version you were compiling with, so if VS2010 follows this precedent you'd need MSVCR100, not MSVCR90 - which suggests that you may not have recompiled the dll with VS2010 - doing so may be another approach to get it running on your PC (using the redist that is in your VS2010 install) but beware that you will still need other users to install the appropriate (VS2010) redistributable on their PC.
As for "Any CPU" versus "x86", this is a problem only on a 64-bit computer. On those systems a 64-bit application can't link dynamically to 32-bit dlls. If you compile your application as "Any CPU" it will be JIT compiled to be 64-bit on an 64-bit OS, so will crash if it tries to call any 32-bit dlls directly. THe solution is to build the application targeting "x86" as that forces the JIT compiler to generate 32-bit code (even on a 64-bit machine) and thus ensures compatibility with the dll you wish to call. If the DLL is a managed assembly, then you can use Any CPU on both the app an dll as they will both be JITted to the same format.
It happened to me something similar running a website in Vistual Studio 2012, after migrating from Visual Studio 2010. The error message was saying that MSVCR90.DLL was missing. The solution was:
1) Delete the folder _bindeployable located at the project path.
2) Rebuild.
I hope it helps.

application failed to initialize properly (0xc0150002) [duplicate]

This question already has answers here:
The application failed to initialize properly (0xc0150002)
(5 answers)
Closed 5 years ago.
my mfc application created in visual studio 5 running on windows server 2000 sp4, i create a release for it and try running it win xp slp2. it gives me application failed to initialize properly (0xc0150002)
i have tried following things
-Install Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) the one that comes within the release folder as well as one downloadable from website
copied all dll and mainfest from microsoft visual sutdio\vc\redist
I still keep receiving the same messsage. c
what could be wrong?how can i fix it
some things to check:
check the /SUBSYSTEM linker option for you project. It might include OS major/minor version numbers.
ensure that you are using appropriate Windows XP PlatformSDK on DEV machine; check values of WINVER, _WIN32_WINNT
use depends to see whether the problem is in unresolved dependencies
check the version of runtime that your application requires with that on target machine. I usually do this by looking at the app's manifest from one side and into WinSxS folder of the target machine from another (recently there had been an ATL Security update from Microsoft http://msdn.microsoft.com/en-us/visualc/ee309358.aspx; new binaries created by updated Visual Studio will not run on machines that haven't the same updated version of runtime).
It is possible you have applied a security update or compiler update to your VS2005 SP1. That makes it generate a manifest that requests a different MFC/CRT-dll than the one installed with Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) .
Try to use Depends.exe and open your application, then in the menu choose "Profile". Look in the output window below for a more detailed description.
Are you trying to run the debug version? That may give you an error similar to 0xc0150002. Try the release build, or you could compile against the static libraries rather than dynamic libraries. If you get this problem on a release build then the chances are that it's a missing dll (in which case try running Depends.exe) or an incorrect manifest.
If you have a missing dependency on a runtime dll you could try creating a deployment project for it as this will detect the appropriate runtime dlls and build it into an installer for you.

Resources