导致错误 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)的更多相关文章

  1. VC++ 链接错误LINK : fatal error LNK1104: cannot open file "*.lib"

    问题描述: 运行VC++编译时经常出现 Linking… LINK : fatal error LNK1104: cannot open file “*.lib” Error executing li ...

  2. 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 ...

  3. LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    同时安装了VS2012和VS2010,用VS2010 时 >LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 问题说明:当安装VS2012之后 ...

  4. 错误提示:LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt 的解决方法

    最近在win7 系统下,打算利用 cmake 生成项目文件,然后用vs2010进行编译.但是在cmake的时候出现错误弹窗:

  5. 解决“LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏”问题

    更新VS2010,或者卸载VS2013安装2010后,建立项目时会出现"LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏"的错误 ...

  6. 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 ...

  7. vs2010 问题 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    vs2010 问题 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 在安装 VS2010 后,再安装 VS2012 VS2015 等,原来的 .N ...

  8. [转]LINK:fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    LINK:fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 原文地址:http://yacare.iteye.com/blog/2010049 很多伙伴在更新VS ...

  9. 彻底解决 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    最近我的VS2010不知道怎么回事,平时用的好好的,近期竟然出现了所谓的 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 头痛万分,查了各种资料一 ...

随机推荐

  1. 我的bootstrap学习

    前端开发框架bootstrap Bootstrap 安装     <link ref="stylesheet" href="bs/css/bootstrap.css ...

  2. 洛谷 P3177 树上染色

    题面 题目要求将k个点染成黑色,求黑点两两距离及白点两两距离,使他们之和最大. 我们可以将距离转化为路径,然后再将路径路径拆分成边,就可以记录每条边被经过的次数,直接计算即可. 很简单对吧?那么问题来 ...

  3. Repository HDU - 2846 (trie)

    题中没给范围 所以控制不好数组范围..不是超内存就是runtime.. 好吧 到了晚上终于调出来数组模拟的了 题意: 求含有某字符段的个数 解析: 把每个字符串遍历一遍 以每个元素为起点建树就好了.. ...

  4. 【NOIP2017】列队(Splay)

    [NOIP2017]列队(Splay) 题面 洛谷 题解 其实好简单啊... 对于每一行维护一棵\(Splay\) 对于最后一列维护一棵\(Splay\) \(Splay\)上一个节点表示一段区间 每 ...

  5. unity3D 涂涂乐使用shader实现上色效果

    unity3D 涂涂乐使用shader实现上色效果 之前我博文里面发过一个简单的通过截图方式来实现的模型上色方法,但是那个方法不合适商用,因为你需要对的很准确才可以把贴图完美截取下来,只要你手抖了一下 ...

  6. VK Cup 2017 Round 3 + Codeforces Round #412

    A 读题题 B 就是你排名第p,得了x分,而最终至少需要y分,你需要最少的successful hack,使得最终得分s>=y,且由s随机取25个数,使p被选中. (1)暴力枚举hack成功几次 ...

  7. 20165218 2017-2018-2 《Java程序设计》课程总结

    20165218 2017-2018-2 <Java程序设计>课程总结 一.每周作业链接汇总 20165218 我期望的师生关系 20165218 学习基础和C语言基础调查 2016521 ...

  8. 【SQL优化】MySQL官网中可优化的层次结构

    正如上一篇中我翻译的那篇文章,关于MySQL数据库优化的宏观介绍,了解到了从大体上来讲,优化MySQL可以从3个角度来讲.那么这一篇文章,则从一个个优化点出发,统计出究竟有多少个地方我们可以来优化My ...

  9. poj1659 Frogs' Neighborhood

    Frogs' Neighborhood Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 10239   Accepted: 4 ...

  10. 图片虚拟目录--即图片保存在window硬盘上面

    这个是图片保存在电脑的硬盘上面的图片上传设置,既不是在web工程中,也不是在专门的图片服务器中,下面是配置方法: r 这里的Document base 我们这里设置为F:\images 如果在浏览器访 ...