简体   繁体   English

LNK2019:函数__tmainCRTStartup中引用的未解析的外部符号_main

[英]LNK2019: unresolved external symbol _main referenced in function __tmainCRTStartup

#include <windows.h> 

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,nShowCmd)
{
    MessageBox(NULL, L"Hello World!", L"Just another Hello World program!", MB_ICONEXCLAMATION | MB_OK);
    return 0;
}

Working through a tutorial for getting started with c++ and can't get the first hello world example to compile. 完成了有关C ++入门的教程,并且无法获得第一个hello world示例进行编译。

Using visual studio express 2012. All I've done is create a new project and copy this into it replacing the tmain function. 使用Visual Studio Express2012。我要做的就是创建一个新项目,并将其复制到其中,以替换tmain函数。

please does anyone know how to resolve this? 请问有人知道如何解决这个问题吗?

In standard C++ program you must have main function so program knows where to start 在标准C ++程序中,您必须具有主要功能,以便程序知道从哪里开始

int main()
{
   return 0;
}

Maybe try another tutorial. 也许尝试另一个教程。 This one seems good. 这个似乎不错。 http://blogs.msdn.com/b/devschool/archive/2013/01/08/writing-your-first-c-program-using-visual-studio-2012.aspx http://blogs.msdn.com/b/devschool/archive/2013/01/08/writing-your-first-c-program-using-visual-studio-2012.aspx

暂无
暂无

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

相关问题 LNK2019:函数___tmainCRTStartup中引用了未解析的外部符号_main - LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 错误 LNK2019:函数 ___tmainCRTStartup 中引用了未解析的外部符号 _main - error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup C ++错误LNK2019:函数_tmainCRTStartup中引用了未解析的外部符号_main - C++ error LNK2019: unresolved external symbol _main referenced in function _tmainCRTStartup 错误 LNK2019:函数 ___tmainCRTStartup 中引用了未解析的外部符号 _main,但这一次不是 Windows/控制台问题! - error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup, but this time it's NOT a Windows/Console problem! 错误LNK2019:函数___tmainCRTStartup和错误2中引用了未解析的外部符号_main错误LNK1120:1个未解析的外部 - error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup and Error 2 error LNK1120: 1 unresolved externals 如何告诉link.exe使用wmain作为入口点。 LNK2019:函数__tmainCRTStartup中引用的主要未解析外部符号 - How to tell link.exe to use wmain as entry point. LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup LNK2019:函数___tmainCRTStartup中引用的未解析的外部符号_WinMain @ 16 - LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup 错误 LNK2019:未解析的外部符号 _WinMain@16 在 function ___tmainCRTStartup 中引用 - error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup 错误LNK2019:函数___tmainCRTStartup中引用了无法解析的外部符号_wWinMain @ 16 - Error LNK2019: unresolved external symbol _wWinMain@16 referenced in function ___tmainCRTStartup LNK2019的另一个错误:函数____tmainCRTStartup中引用了无法解析的外部符号_WinMain @ 16 - Another error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM