Program looking for msvcp140D.dll instead of msvcp120D.dll - c++

Before you say that this is a duplicate question, I have tried everything I could find on stackoverflow and Microsoft forums but none of them worked for me. I have Visual Studio 2013 installed on my Windows 10 machine. My project's target and platform versions say V 12 but when I try to open the executable, it tries to find msvcp140D.dll instead of msvcp120D.dll
How do I make it get the msvcp120D.dll?
I have both the 2015 and 2013 C++ distributables installed.
I also tried to change the code generation properties to /mT and /mTD but it gives a lot of errors when I do that. Any help appreciated. Thanks in advance!

Related

Cannot open source file in a CMake Project in Visual Studio

I have a C++ Project in Visual Studio 2022 (Windows 11) that is put together using CMake. I understand that the difference here is, that my project is not a Solution but rather just folders with code and the CMake tells it how to compile it?
But my problem is, that it doesn't seem to find C's standard libraries and shows error "cannot open sourcefile".
Screenshot
The error is definitely not in the project, since it runs just fine on my laptop, just not on the PC I want it to run on.
How can I tell it where these libraries are? Where are they located even?
Any help would be greatly appreciated and I can share more files on request.
Things I have tried:
Going to properties and choose the correct Windows SDK Version - The properties are empty
Comparing every variable of the CMake Settings with the ones on my laptop where it works
completely reinstalling Visual Studio (yes I did that)
looking through lots of StackOverflow questions but none of them describe my problem

Installing socket.io C++

I try to work with socket.io in C++ but I can't seem to get the example running.
First it asked me to convert the project to my visual studio (which is 2015). So I did that. Then it was missing libraries offcourse (boost, websocket++, rapidjson). So I added them to the additional libraries in the project settings. Then it was searching for boost.lib. Boost.lib doesnt exist in the boost library I installed on my pc, so I deleted it from the dependency list. I figured I already included boost, why would it search for a lib that doesn't exist. I ran bjam.exe and b2.exe etc from boost, so if there would be a boost.lib it should be there I guess and it isn't.
I then got this error: https://msdn.microsoft.com/en-us/library/f6xx1b1z.aspx
So I added msvcrt.lib and msvcmrt.lib to the linker's Additional Dependencies property. Which caused the errors in the included image..
Now all the steps seemed to fix the problems I had, but also create more errors in the process. I do not understand how to run a project like this and I can't find a good explanation of the steps I need to take.
Can anyone explain what I am doing wrong?
https://github.com/socketio/socket.io-client-cpp
That is what I try to run, the included SioChatExample
Thanks for any help in advance!
Current errors..... :(
i think many errors because of VC++ version.
creator of project Socket.io-c++, he used VC++ 11.0
if you use VC++ 14.0 to build it, you will get the error. for suggestion you should use VC++ 12.0
In cast you want to use prebuilt libraries:
i myself just try many solutions,
goodness i fix all
you can get them here Prebuilt-libraries-for-Socket.io-c++
for Visual Studio 2015, what u need are:
install more Visual Studio 2013 (i install Visual Studio 2013 community) to get VC++ 12.0 (prebuilt-lib is built in VC++ 12.0)
change your project Platform Toolset to Visaul Studio 2013 (v120)
link libraries to your project
libraries you need are:
libboost_date_time-vc120-mt-gd-1_50.lib
libboost_random-vc120-mt-gd-1_50.lib
libboost_system-vc120-mt-gd-1_50.lib
sioclient.lib
include folder of *.h (header of Socket.io-C++) to your project
build and run

Building OpenCV 3.0.0's DLLs for Visual Studio 2015 with Cmake

Following the instructions here:
docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to
I setup an OpenCV project in VS 2015 Community and used the pre-built libraries. It works until I get this message:
"MSVCP120D.dll is missing from your computer"
From doing some searching I gathered this means that the pre-build libraries are only supposed to be used with an older version of VS so I figured I'd just compile them myself using this:
docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windowssetpathandenviromentvariablehere
While it appears to compile properly and despite flagging "BUILD_SHARED_LIBS" I can't find any DLL files in the output - just a lot of VS solutions:
imgur.com/JdSc5CH
Would someone be able to give me some advice on how to generate the DLLs?
thanks!
I'm a beginner at this stuff. I've since learned a lot about Visual Studio, about CMake and about OpenCV. Got it all working now, took me a day or two.
It turns out you have to compile the openCV library from git repository in order to be compatible with Visual Studio (VS14) 2015. As of this date, no go on pre-compiled version supporting VS14.
I've organized what I've learned, placed it online here in case anybody else has the same frustrations. Its pretty detailed, too much content to post here.
VS2015 uses MSVCP140.dll, I think your error message is about a redistributable package of VS2013.
And try BUILD_SHARED_LIBS as on/off.

opencv 2.4.3 configuration issue with visual studio 2010

I have tried to install and configure opencv and link it with visual studio 2010 in 32bit windows 7 but after all the configuration when i debug a piece of code i get this error really need help please help.
"error LNK1181: cannot open file 'opencv_calib3d243d.lib'"
"'opencv_calib3d243d.lib'" was included during the configuration, but still i get this error.
I have followed the coniguration procedure from here.
Installing OpenCV 2.4.3 in Visual C++ 2010 Express
There might be 2 things that are the source of your woes:
You are trying to link to x64 instead of x86 (this is assuming that your OS is 32-bit, of course)
You haven't specified the Linker Directory properly.
I would advise you to use CMake to link your libraries as it will make your life a lot simpler.. Please refer to my answer to this question for details..

MSVCP100D.dll missing

When I try to debug my C++ application I get the error
The program can't start because MSVCP100D.dll is missing from your
computer. Try reinstalling the program to fix this problem.
I found someone with a similar problem here: Remote debugging C++ on the Windows Server 2008 platform with VS2010; MSVCP100D.dll missing however the solution given there doesn't seem to show up when I go to the solution properties.
Would reinstalling Visual Studio fix this problem?
Usually you don't want MSVCP100D.dll on your system. It's for debugging purposes only. If you get this error for your release build you must make sure that you didn't accidently add a 'Debug'-tagged Project Output to your setup project.
If you really need to debug your software on a remote machine, I suggest you do the following:
Create a new Setup project called 'CRTDebug100Setup' and add the following Merge Modules (found under C:\Program Files\Common Files\Merge Modules):
Microsoft_VC90_DebugCRT_x86.msm
policy_9_0_Microsoft_VC90_DebugCRT_x86.msm
Build, and deploy on your computer to be debugged!
Reinstalling Visual Studio fixed the problem.
This can also occur if Generate Debug info is not set to No
Configuration Properties -> Linker -> Debugging -> Generate Debug info
Followup on l33t's answer above (tried to revise it but it did not seem to appear).
Added later by gpicher 10 Jan 2012: I believe those .msm packages would be for a 9.x version of the DLL in question, not a 10.x version. I resolved a similar problem I had by making a setup project with Visual Studio 2010 installed on a 64 bit Windows installation, using the merge module Microsoft_VC100_DebugCRT_x86.msm in the folder C:\Program Files (x86)\Common Files\Merge Modules. There's a similar x64 version of the .msm if the application showing the error dialog is a 64 bit application. In this case a third party was providing me a debug build of their application in order to develop and test new plugin code against, so I couldn't change build settings, and wanted the debug functionality.
Find the Visual Studio 2010 install iso file.
Extract cab44.cab file from the ISO.
Then extract file "F_REDIST_DLL_APPLOCAL_msvcp100d_x86" from the .cab file using 7z.
Rename the file to msvcp100d.dll.
For x64 version. The cab file name is cab26.cab and the file name is F_REDIST_DLL_APPLOCAL_msvcp100d_x64.
For similar issue such missing msvcr*d.dll for another visual studio version. Here is the way I used to find the answer:
Find the Visual Studio ISO.
Extract all the .cab file.
7z.exe t *.cab > filelist.txt
gvim filelist.txt
searching for the interested file name. Hope this helps.