简体   繁体   English

Visual Studio Community 2019 的新手问题:简单 C 项目中的错误代码 LNK2019 和 LNK1120

[英]Newbie Problems with Visual Studio Community 2019: Error Codes LNK2019 & LNK1120 in a Simple C Project

I started learning the Windows API in C today, and also started using Visual Studio Community 2019. I created a file called main.c with the following code, and put it in a project called Test Program . I started learning the Windows API in C today, and also started using Visual Studio Community 2019. I created a file called main.c with the following code, and put it in a project called Test Program .

#include <windows.h>

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR pCmdLine, int nCmdShow) {
    return 0;
}

That was the only file in the project, and when I build the project I get the following errors:那是项目中唯一的文件,当我构建项目时,出现以下错误:

在此处输入图像描述

Can I please get some help with this?我能得到一些帮助吗?

EDIT: PLEASE READ编辑:请阅读
I figured out the answer to this.我想出了这个问题的答案。 All you need to do is simply re-create the project in Visual Studio, and follow this tutorial .您只需在 Visual Studio 中重新创建项目,然后按照本教程进行操作即可。

The C program requires a void main() function. C 程序需要一个 void main() function。 It is where your program starts.这是您的程序开始的地方。 You must add a void main function to your code.您必须在代码中添加一个 void main function。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM