C++ Fatal Error LNK1120: 1 unresolved externals

后端 未结 8 1281
[愿得一人]
[愿得一人] 2020-11-29 09:27

What is causing this error? I google\'d it and first few solutions I found were that something was wrong with the library and the main function but both seem to be fine in m

8条回答
  •  清歌不尽
    2020-11-29 10:01

    From msdn

    When you created the project, you made the wrong choice of application type. When asked whether your project was a console application or a windows application or a DLL or a static library, you made the wrong chose windows application (wrong choice).

    Go back, start over again, go to File -> New -> Project -> Win32 Console Application -> name your app -> click next -> click application settings.

    For the application type, make sure Console Application is selected (this step is the vital step).

    The main for a windows application is called WinMain, for a DLL is called DllMain, for a .NET application is called Main(cli::array ^), and a static library doesn't have a main. Only in a console app is main called main

提交回复
热议问题