如何解决visual c ++中"未解决的外部符号"链接错误?

Vic*_*tor 3 c++ visual-studio-express visual-studio-2008 visual-studio visual-c++

我有Visual Studio C++ 2008速成版.

我正在尝试编译程序,但我收到以下链接错误:

1>MSVCRT.lib(wcrtexew.obj) : error LNK2001: unresolved external symbol _wWinMain@16
Run Code Online (Sandbox Code Playgroud)

我试图做的:

我在谷歌上发现了这个:

For Visual C++ .NET: In the Advanced category of the Linker folder in the Project Properties dialog box, set the Entry Point to wWinMainCRTStartup.
Run Code Online (Sandbox Code Playgroud)

它的目的是工作,但没有.我该如何编译这个应用程序?

代码非常简单:

#include "stdafx.h"
int main( int argc, char ** argv )
{
}
Run Code Online (Sandbox Code Playgroud)

Vin*_*enz 7

有多种方法可以解决这个问题:

  1. 创建控制台应用程序
  2. 现在在链接器设置中更改子系统控制台(项目设置 - >链接器 - >系统 - >子系统(选择控制台))
  3. 将链接器设置中的入口点更改为mainCRTStartup(项目设置 - >链接器 - >高级 - >入口点)
  4. 定义int CALLBACK WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow );而不是int main(int argc, char const ** argv)

  5. 将字符集更改为使用Unicode字符集(项目设置 - >常规 - >字符集)