ERROR in vc 6.0 (LINK : fatal error LNK1561: entry point must be defined)
2013-08-10 09:33
519 查看
导致错误 LINK : fatal error LNK1561: entry point must be defined 的原因有很多种, 网上可以搜到很多,
一般是函数入口没定义, 或者修改为/subsystem:windows /entry:mainCRTStartup,
或者使用下面的语句:
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
这里我碰到的情况比较特别, 我的是一个VC 6.0的静态lib工程(VC 2008上编译正常), 竟然报入口点没定义, 奇怪吧.
而且Release版本编译正常, 错误仅出现在Debug版, 尝试了各种方法都解决不了.
最后搜索到下面这个帖子, 里面有个回复提到一个MSDN的kb, 尝试了一下, 结果解决了, 这种情况非常少见, 希望对你有用.
参考: http://bbs.csdn.net/topics/337691
在36楼的回复:
PRB: Missing /c Compiler Option Causes LNK1561 Linker Error
Q228455
--------------------------------------------------------------------------------
The information in this article applies to:
Microsoft Visual C++, 32-bit Editions, version 6.0
--------------------------------------------------------------------------------
SYMPTOMS
When compiling a multiple source file project that creates a pre-compiled header file inside the Visual C++ Integrated Development Environment (IDE), the following error can occur:
Compiling...
StdAfx.cpp
LINK : fatal error LNK1561: entry point must be defined
Error executing cl.exe.
NOTE: The linker error is generated during the compiler phase of the build.
CAUSE
The /c compiler option is missing from the build settings.
RESOLUTION
Add /c to the compiler options. To do this, you must edit the compiler options in the Project Options box in the C/C++ tab under Project Settings.
NOTE: This box is only editable if the whole project is selected in the tree control on the Project Settings.
STATUS
This behavior is by design.
MORE INFORMATION
By default, the Visual C/C++ compiler attempts to compile and link in a single step. The /c (Compile without Linking) option is used to tell the compiler to compile only. Since Visual C++ compiles and links in separate steps, then /c is required for all Visual C++ builds.
To reproduce the error, create a default MFC project and remove the /c option from the Project Settings by editing the compiler options in the Project Options box in the C/C++ tab under Project Settings.
REFERENCES
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Kelly Marie Ward, Microsoft Corporation
Additional query words:
Keywords : kbCompiler kbLinker kbVC600
Issue type : kbprb
Technology : kbvc
Last Reviewed: February 4, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.
一般是函数入口没定义, 或者修改为/subsystem:windows /entry:mainCRTStartup,
或者使用下面的语句:
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
这里我碰到的情况比较特别, 我的是一个VC 6.0的静态lib工程(VC 2008上编译正常), 竟然报入口点没定义, 奇怪吧.
而且Release版本编译正常, 错误仅出现在Debug版, 尝试了各种方法都解决不了.
最后搜索到下面这个帖子, 里面有个回复提到一个MSDN的kb, 尝试了一下, 结果解决了, 这种情况非常少见, 希望对你有用.
参考: http://bbs.csdn.net/topics/337691
在36楼的回复:
PRB: Missing /c Compiler Option Causes LNK1561 Linker Error
Q228455
--------------------------------------------------------------------------------
The information in this article applies to:
Microsoft Visual C++, 32-bit Editions, version 6.0
--------------------------------------------------------------------------------
SYMPTOMS
When compiling a multiple source file project that creates a pre-compiled header file inside the Visual C++ Integrated Development Environment (IDE), the following error can occur:
Compiling...
StdAfx.cpp
LINK : fatal error LNK1561: entry point must be defined
Error executing cl.exe.
NOTE: The linker error is generated during the compiler phase of the build.
CAUSE
The /c compiler option is missing from the build settings.
RESOLUTION
Add /c to the compiler options. To do this, you must edit the compiler options in the Project Options box in the C/C++ tab under Project Settings.
NOTE: This box is only editable if the whole project is selected in the tree control on the Project Settings.
STATUS
This behavior is by design.
MORE INFORMATION
By default, the Visual C/C++ compiler attempts to compile and link in a single step. The /c (Compile without Linking) option is used to tell the compiler to compile only. Since Visual C++ compiles and links in separate steps, then /c is required for all Visual C++ builds.
To reproduce the error, create a default MFC project and remove the /c option from the Project Settings by editing the compiler options in the Project Options box in the C/C++ tab under Project Settings.
REFERENCES
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Kelly Marie Ward, Microsoft Corporation
Additional query words:
Keywords : kbCompiler kbLinker kbVC600
Issue type : kbprb
Technology : kbvc
Last Reviewed: February 4, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.
相关文章推荐
- VC++ 常见调试错误:fatal error LNK1561: entry point must be defined
- VC++ 常见调试错误:fatal error LNK1561: entry point must be defined
- LINK : fatal error LNK1561: entry point must be defined
- VC++ 常见调试错误:fatal error LNK1561: entry point must be defined
- VC++ 常见调试错误:fatal error LNK1561: entry point must be defined
- The procedure entry point XXX could not be located in the dynamic link library XXX.dll
- Error LNK1561: entry point must be defined
- ERROR: No pool defined. at least one pool section must be specified in config file
- 编译错误 fatal error LNK1561: entry point must be defined
- IAR遇到问题Error[e72]: Segment XDATA_HEAP must be defined in a segment definition option (-Z, -b or -P)
- PHP error:ERROR: No pool defined. at least one pool section must be specified in config file
- Fatal Error[e72]: Segment INTRAMEND_REMAP must be defined in a segment definition option (-Z, -b or
- the procedure entry point **(function symble) could not be located in the dynamic link library **.dl
- 安装VC 6.0,出现 DOSX.EX must be in your AUTOEXEC.NT的信息
- ValueError: fill value must be in categories.
- Segment FRAM_DATA must be defined in a segment definition option (-Z, -b or -P)
- sharepoint admin svc must be running in order to create deployment timer job 若要创建计时器作业,必须运行SVC
- JAVA中 错误代码是 the public type must be defined in its own file 解决方法 android开发 java编程
- sharepoint admin svc must be running in order to create deployment timer job 若要创建计时器作业,必须运行SVC
- error LNK2005: "class CPoint StartPt" (?StartPt@@3VCPoint@@A) already defined in mypicture.obj 解决