Tag Archives: Visual studio error

How to Solve Visual Studio C4996 Error

Follow the path VisualStudio\Common7\IDE\VC to find the folder VCProjectItems:

Right click to grant access permission -> Specific user

Click “share”

Enter the folder VCProjectsItems and open the file newc++file.cpp with Notepad. Paste the following into the file and save:

#define _CRT_SECURE_NO_WARNINGS 1

Right-click the folder VCProjectItems and click Properties -> Share -> Advanced sharing, click “share this folder” to uncheck it, and click “apply” and “OK”.

This will solve the problem. Create a new C/C + + file in vs. you can see the following code on the first line:

#define _CRT_SECURE_NO_WARNINGS 1

​​​​​​​

In this way, no error will be reported when using functions such as scanf(), printf().

Solve the problem of “error msb6006: link.exe Exited, bad method with code 2

I used to write code in Codeblocks when I was learning. When I went to an interview with a company, they gave me VS for a compiler. I had no idea how to use it before. (The reason I didn’t use VS when I wrote my own code was that the VS bucket was too big, and when it was running it was stalling and the computer wasn’t powerful enough, so I had to use Codeblocks.)
To no longer continue to eat this kind of lose, I will go to install a VS2019, write a helloworld after installed, incredibly can’t run, according to the system error can not find the specified file, and this “error MSB6006: link the. Exe has quit, code for 2”, so I went online to find ways to try, what reload solution, adding SDK components, delete files under the installation path, restart the software such as a variety of methods are tried, all useless, for the morning. In the end, I found a solution in a blog, which was to turn off all the security software and firewalls. PS: I had a pop-up blocker on, turned it off, and VS compiled and ran. We’re done.