VC6.0 error LNK2001: unresolved external symbol _main

简介:
VC6.0 error LNK2001: unresolved external symbol _main
[时间]:2008-8-12
[问题]:
最简单的Win32程序示例:
#include <windows.h> 
int WINAPI WinMain (HINSTANCE hInstance, 
                 HINSTANCE hPrevInstance, 
                 PSTR szCmdLine, 
                 int iCmdShow) 

MessageBox( NULL"Hello, Win32!""问候", MB_OK) ;  

return 0 ; 

在使用VC6.0直接编译cpp文件时(未通过AppWizard)出现错误:
error LNK2001: unresolved external symbol _main
在创建项目时, 不使用AppWizard向导, 就有可能在编译时产生很多连接错误, 
如error LNK2001错误, 典型的错误提示有:
error LNK2001: unresolved external symbol _main
[解决]:
error LNK2001: unresolved external symbol _main.
这是Windows子系统设置错误.
Windows项目要使用Windows子系统, 而不是Console, 可以这样设置: 
[Project] --> [Settings] --> 选择"Link"属性页,
在Project Options中将/subsystem:console改成/subsystem:windows。


本文转自wintys 51CTO博客,原文链接:http://blog.51cto.com/wintys/92284
相关文章
|
4月前
|
存储 API Windows
MASM32连接程序时error A2006: undefined symbol : u
MASM32连接程序时error A2006: undefined symbol : u
undefined reference to symbol 'dlsym@@GLIBC_2.17' libdl.so: error adding symbols: DSO missing from c
undefined reference to symbol 'dlsym@@GLIBC_2.17' libdl.so: error adding symbols: DSO missing from c
643 0
curl: symbol lookup error: curl: undefined symbol: curl_mime_free
curl: symbol lookup error: curl: undefined symbol: curl_mime_free
350 0
网易云/opt/netease/netease-cloud-music/netease-cloud-music: symbol lookup error: /lib/x86_64-linux-gnu/
网易云/opt/netease/netease-cloud-music/netease-cloud-music: symbol lookup error: /lib/x86_64-linux-gnu/
155 0
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
159 0
symbol lookup error: /home/quantum6/build_libs/lib/libreadline.so.7: undefined symbol: UP
symbol lookup error: /home/quantum6/build_libs/lib/libreadline.so.7: undefined symbol: UP
131 0
解决办法:look up error: undefined symbol
解决办法:look up error: undefined symbol
386 0
|
Perl
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1
728 0
|
Java
error LNK2001: 无法解析的外部符号unresolved external symbol __imp__JNI_CreateJavaVM@12
error LNK2001: 无法解析的外部符号unresolved external symbol __imp__JNI_CreateJavaVM@12
103 0
|
8月前
|
JavaScript 前端开发
ES6:什么是Symbol?
ES6:什么是Symbol?
99 1