ERROR in vc 6.0 (LINK : fatal error LNK1561: entry point must be defined)
导致错误 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.
ERROR in vc 6.0 (LINK : fatal error LNK1561: entry point must be defined)的更多相关文章
- VC++ 链接错误LINK : fatal error LNK1104: cannot open file "*.lib"
问题描述: 运行VC++编译时经常出现 Linking… LINK : fatal error LNK1104: cannot open file “*.lib” Error executing li ...
- pydensecrf安装报错1、UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 29: invalid start byte2、 LINK : fatal error LNK1158: 无法运行“rc.exe” error: command 'D:\\software\\vs2015\\VC\\BIN
pydensecrf安装报错 1.UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 29: invalid st ...
- LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
同时安装了VS2012和VS2010,用VS2010 时 >LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 问题说明:当安装VS2012之后 ...
- 错误提示:LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt 的解决方法
最近在win7 系统下,打算利用 cmake 生成项目文件,然后用vs2010进行编译.但是在cmake的时候出现错误弹窗:
- 解决“LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏”问题
更新VS2010,或者卸载VS2013安装2010后,建立项目时会出现"LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏"的错误 ...
- LinkIssue: Error 'LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or cor
参考:http://blog.csdn.net/junjiehe/article/details/16888197 使用VisualStudio 编译链接中可能出现如下错误: LINK : fatal ...
- vs2010 问题 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
vs2010 问题 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 在安装 VS2010 后,再安装 VS2012 VS2015 等,原来的 .N ...
- [转]LINK:fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
LINK:fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 原文地址:http://yacare.iteye.com/blog/2010049 很多伙伴在更新VS ...
- 彻底解决 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
最近我的VS2010不知道怎么回事,平时用的好好的,近期竟然出现了所谓的 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 头痛万分,查了各种资料一 ...
随机推荐
- Best Reward HDU - 3613(马拉车+枚举+前缀和)
题意: 给你一串字符串,每个字符都有一个权值,要求把这个字符串在某点分开,使之成为两个单独的字符串 如果这两个子串某一个是回文串,则权值为那一个串所有的字符权值和 若不是回文串,则权值为0 解析: 先 ...
- 使用StoryBoard执行动画
在WPF动画编程中,最常用的动画处理方式是DoubleAnimation动画,但是随着你的开发经验越来越多,你会发现,有时候使用这个动画类会很麻烦,因为这个动画是封闭动画,也就是说在动画的时间间隔内, ...
- Yura
Portal --> broken qwq Description 给你一个长度为\(n\)的序列\(a\)和一个正整数\(k\),求满足如下条件的区间\([l,r]\)的数量:\((\s ...
- Lipshitz
Portal --> broken qwq Description 大M正在学习函数的光滑性并对Lipschitz常数非常感兴趣:当一个定义域为\([l,r]\)的函数\(f\),对于定义域内的 ...
- hibernate实现数据实体复制保存
hibernate实现数据实体复制保存 2013年12月16日 11:57:22 Hardy008 阅读数:3474 描述:需要将数据的一条记录进行复制保存为一条新记录. 思路:从数据库中取得一条 ...
- PID控制算法的C语言实现六 抗积分饱和的PID控制算法C语言实现
所谓的积分饱和现象是指如果系统存在一个方向的偏差,PID控制器的输出由于积分作用的不断累加而加大,从而导致执行机构达到极限位置,若控制器输出U(k)继续增大,执行器开度不可能再增大,此时计算机输出控制 ...
- Linux下调整根目录的空间大小
原文 一.目的 在使用CentOS6.3版本Linux系统的时候,发现根目录(/)的空间不是很充足,而其他目录空间有很大的空闲,所以本文主要是针对现在已有的空间进行调整.首先,先来查看一下系统的空间分 ...
- c# extern 关键字
TEST.DLL 项目引用TEST.DLL 调用其中的方法 结果如下:
- jdbc:oracle:thin:@localhost:1521:orcl和jdbc:oracle:thin:@localhost:1521/orcl的区别
Oracle Thin JDBC Driver 驱动程序包名:ojdbc14.jar.ojdbc6.jar 驱动程序类名: oracle.jdbc.driver.OracleDriver JDBC ...
- python列表排序方法reverse、sort、sorted
python语言中的列表排序方法有三个:reverse反转/倒序排序.sort正序排序.sorted可以获取排序后的列表.在更高级列表排序中,后两中方法还可以加入条件参数进行排序. reverse() ...