WIN32 project - 'LNK1104 : cannot openmfc140d.lib' when I compile a project in my solution - c++

I used Visual Studio 2019. I've a WIN32 project. For this project, I used the Nuget manager to install Microsoft.Web.WebView2 (version 1.0.902.49) and Microsoft.Windows.ImplementationLibrary (version 1.0.210803.1) and in the project properties, here is the configuration :
Since I changed the property "Platform Toolset" from Visual Studio 2015 to Visual Studio 2019, I've an error at the compil : 'cannot open file mfc140d.lib'. I don't need MFC for this project. So, in the configuration of the linker, I decided to add in "Ignore Specific Default Libraries" the mfc140d.lib. And then, I tried to compil again but I got another error compil with another MFC dll.
Why do I get all those error message ? Why do I need MFC ? Can you explain what have I to do ?
Thank you
I've tried to uninstall the two packages Microsoft.Web.WebView2 and Microsoft.Windows.ImplementationLibrary and then, compil again but I've always got the same error message

Related

LNK1104 cannot open file boost_thread-vc140-mt-gd-1_61.lib

I am using Microsoft Visual Studio Professional 2017, Version 15.9.25
Visual C++ 2017 - 00369-60000-00001-AA984
ASP.NET and Web Tools 2017 - 15.9.04012.0
ASP.NET Core Razor Language Services - 15.8.31590
ASP.NET Web Frameworks and Tools 2017 - 5.2.61435.0
When I compile the project I'm getting:
1>LINK : fatal error LNK1104: cannot open file 'boost_thread-vc140-mt-gd-1_61.lib'
I've searched all the files in the Project folder and I can see no reference to this file, I am using Boost 1.61 and all I can see in the boost folder is:
c:\boost\boost_1_61_0\stage\lib\boost_thread-vc120-mt-1_61.lib
How do I change the project settings to get it to use the correct file?
Open the project properties, right click Project in Solution Explorer
From the Configuration Properties click on the Platform Toolset and change the setting to Visual Studio 2013 (v120)
Click on the OK button.
Clean project and rebuild.

solutions wont build after updating visual studio 2017

My project was working fine before I updated to the new release of VS 2017. After updating, my solutions opens but wont build and when I try to build, it says that the version of visual studio are not compatible.
what can I do? Or does anyone know how to uninstall the update so i can get my solution working again
Error message
A Project with an output type of class library cannot be started directly. In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project,.

Cannot compile new project targeting WinXP after installing VS2015 Update 3

Steps to reproduce:
1. install vs2015 u3 RC
2. create a new win32 project
3. set Platform toolset to "Visual Studio 2015 - Windows XP (v140_xp)"
You can find the setting here:
Project -> Configuration properties -> General
4. Build
fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
(without step 3, it will compile just fine)
This is a known problem with Visual Studio 2015 Update 3 RC.
Visual C++ project build fails when using the v140_xp PlatformToolset
Issue:
When using PlatformToolset v140_xp, UCRT is not added to the Include
and Library path.
Workaround:
In Visual Studio, go to the Solution Explorer.
Right click on the project, click on “Properties” Find and Select “VC++ Directories”
Append Includes Directory with “$(MSBuildProgramFiles32)\Windows
Kits\10\Include\10.0.10240.0\ucrt”
Append Library Directory with “$(MSBuildProgramFiles32)\Windows
Kits\10\lib\10.0.10240.0\ucrt\$(PlatformShortName)”
Click OK or Apply to Save.

Linker: cannot open file 'nafxcwd.lib'

I have problem with compiling my project via visual studio 2013. I got this linker error:
LINK : fatal error LNK1104: cannot open file 'nafxcwd.lib'
According to this page, I must use MFC in shared library. But I don't use MFC at all.
All my libraries and main project compiled using Use Standard Windows Libraries settings. This problem occurs only when I try to build project via Visual Studio 2013 toolchain, but it successfully built with Visual Studio 2010 toolchain.
P.S. project has been moved from Visual Studio 6.0 to Visual Studio 2013.
It appears that in Microsoft Visual C++ 6.0 Standard Edition does not support statically linking with the MFC libraries as the Microsoft page says . But in Visual Studio 2013 you can link staticaly with Microsoft Libraries . Check this link https://support.microsoft.com/en-us/kb/243458 in order to solve your problem.
From The Microsoft Site :
To change your MFC project setting to link dynamically to the MFC libraries, perform the following steps:
Open your MFC project.
From the Project menu, click Settings.
In the Settings For combo box, select All Configurations. Click the
General tab. If it is not visible, use the tab scroll buttons to
scroll to the left.
In the Microsoft Foundation Classes combo box, select Use MFC in a
Shared DLL. Click OK to save the changes.
I had the same issue except it compiled on one machine but not another. Solved by installing the Multibyte MFC Library for Visual Studio 2013 as suggested in: MBCS Error building MFC C++ project with Visual Studio
To isolate the culprit that consumes MFC, link with /VERBOSE and search the output for nafxcwd. Most probably it would appear after a /DEFAULTLIB directive - just note which library was loaded exactly before the directive.
Going through updating a VS 2008 project which did not use MFC at all, I faced this same problem and fixed it doing these three steps. Please see the shot to have a glance on the properties of the project (VS 2008) highlighted.
Step-1
Please add this line #define _AFXDLL in your stdafx.h file
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _AFXDLL
Step-2
Go to your VS 2013 solution and open "Project Properties -> C/C++ -> Code Generation -> Runtime Library" and change the value to Multi-threaded Debug DLL (/MDd) (adjust your release configuration to Multi-threaded DLL (/MD), once you will complete these two steps you will start getting this linking error
error LNK1104: cannot open file 'mfc120d.lib'
Now, here you have to set the "Character Set" for your project to Unicode instead of _MBCS
Step-3
Now open "Project Properties -> General -> Project Defaults -> Character Set" and change the value to Use Unicode Character Set, now this part requires little more patience and work, you have to change your string traits to either wchar_t or TCHAR in your source files.
Hope it would solve your problem.

Not able to build a Qt project in visual studio 2005

When i am building my project in visual studio 2005 its end up with the following error
fatal error LNK1181: cannot open input file 'QtCored.lib'.
Please let me know where i am failing .
When we are integrating Qt 4.7.3 with visual studio 2005 and tries to create one Qt project in IDE , its giving a fatal error stating Qtcored.lib is missing . Actually if you go ..\Qt\4.7.3\lib folder there is nothing called Qtcored.lib ,But there is Qtcored4.lib . I think they have renamed it (not sure) . Now goto projproperties->linker->input->additionaldependency and remove Qtcored.lib from there and add Qtcored4.lib. Now if you build the project it will work fine ..
Cheerssss.. :)
Visual studio is not able to find the library file QtCored.lib. You have to specify the library path of it in visual studio settings.