Visual c++ c program creation and link execution failure processing (notes)

1. Create a new c program (if you have already read 2 directly)

  1. Click "File" in the upper right corner and click "New".
    Insert picture description here

Click "Project" and select "win32 Console Application".
Insert picture description hereName and confirm.
Insert picture description here
Select "an empty project".
Insert picture description here

3. Click New to create a "C++ Source File".
Insert picture description hereName the file.
Insert picture description here3. Write a simple code,
Insert picture description here
compile and
Insert picture description herelink
Insert picture description hereexecution
Insert picture description here

2 possible errors

1 Compilation is successful but link error
Insert picture description here
Insert picture description here

Solution:
1 It is possible that the program is running and the compiler cannot rewrite the file. Open the task manager to see if there is a process for the file. If so, end it.
Task Manager: Ctrl+Shift+Esc.
3. Run as an administrator (the solution is the best)
2. It may be that the directory configuration is incorrect when compiling, but I still don't know how to solve it [dog head]
Insert picture description here
Insert picture description here
2. Create a new c++ file in the same project, but it prompts that the link is wrong.
Insert picture description here

Reason: A project in C language can only have one main function.

Solution: Create a new project or delete the original file.

Guess you like

Origin blog.csdn.net/RunningBeef/article/details/105848801