阅读:1532回复:6
关于DLL程序在Release中的一个问题?
我在用DEBUG调试完一个DLL程序后(一切正常),但当我在Release时,却出现了一个连接错误(错误信息见附注),请问这是什么原因,如何解决?
附注: Linking... Creating library ReleaseMinSize/myprogram.lib and object ReleaseMinSize/myprogram.exp LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main ReleaseMinSize/myprogram.dll : fatal error LNK1120: 1 unresolved externals Error executing link.exe. |
|
沙发#
发布于:2002-03-01 09:16
你打开 project->Link, 然后仔细观察 Object/Libary module: 中包含的库,在Debug与Release有什么不一样,然后在Release中添加中即可。我怀疑你少了 LIBCMT.lib 这个库
|
|
板凳#
发布于:2002-03-03 11:36
谢谢你的回答,但是我以前试着加了这个库,还是不行,我再仔细试一试。
|
|
地板#
发布于:2002-03-04 20:57
blue: 我打开 project->Link, 但在Object/Libary module: 中包含的库中,Debug与Release都是一样的。都不含LIBCMT.lib,而且我在Release加了这个库,也还是不行。
|
|
地下室#
发布于:2002-03-05 01:32
It seems you are building a ATL library with Minimum Size configuratio.
When building a Release version of an ATL project, indicates that CRT startup code is required. To fix, do one of the following, 1. Remove _ATL_MIN_CRT from the list of preprocessor defines to allow CRT startup code to be included. See General Configuration Settings Property Page for more information. or: 2. If possible, remove calls to CRT functions that require CRT startup code. Instead, use their Win32 equivalents. For example, use lstrcmp instead of strcmp. Known functions that require CRT startup code are some of the string and floating point functions. Of course, you can ignore method 2, just try method 1. [编辑 - 3/5/02 作者: kanghai] |
|
|
5楼#
发布于:2002-03-09 10:55
kanghai,thank you. it\'s ok!
|
|
6楼#
发布于:2002-03-14 20:56
我也碰到相同问题,这下解决了
不过我没分给你 谢谢 |
|