5

请帮忙。在 Visual Studio 2008 上,我收到以下错误。

============================================================

   1>Microsoft (R) Windows Resource To Object Converter Version 9.00.30729.01
   1>Copyright (C) Microsoft Corporation.  All rights reserved.
   1>adding resource. type:ICON, name:1, language:0x0409, flags:0x1010, size:744
   1>adding resource. type:ICON, name:2, language:0x0409, flags:0x1010, size:296
   1>adding resource. type:GROUP_ICON, name:128, language:0x0409, flags:0x1030, size:34
   1>adding resource. type:DIALOG, name:100, language:0x0409, flags:0x1030, size:374
   1>adding resource. type:DIALOG, name:102, language:0x0409, flags:0x1030, size:784
   1>adding resource. type:VERSION, name:1, language:0x0409, flags:0x30, size:928
   1>adding resource. type:STRING, name:7, language:0x0409, flags:0x1030, size:68

   1>LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup

   1>.\Release/DiskTest.exe : fatal error LNK1120: 1 unresolved externals

   1>Build log was saved at "file://c:\WinIRDir\Utilities\DiskTest\Release\BuildLog.htm"
   1>DiskTest - 2 error(s), 0 warning(s)
   1>Build log was saved at "file://c:\WinIRDir\Utilities\CommApp\Release\BuildLog.htm"
==============================================================

这是情况。- DiskTest.exe 是我的解决方案中的 3 个项目之一 - 该项目非常适合 Debug x64、Release x64 和 Debug Win32。发行版 Win32 是唯一产生这些错误的版本。- 我花了几个小时比较所有 4 种配置/机器组合的属性页面,并且确信从一个版本到下一个版本都没有丢失任何属性。我特别注意了“附加依赖项”、“附加库目录”、“输入”等。当然,.lib 文件的路径指向 \Debug 或 \Release,以及各自配置或平台的 \x86 或 \x64 .

该项目唯一的“附加依赖项”是用于调试的 SBF_Util.lib 和 SBF_Utild.lib。我确保该库的所有 4 个版本(调试 win32 和 x64,以及发布 win32 和 x64)都存在于每个“附加库目录”中指定的文件夹中我还检查了每个版本的库的 dumpbin 以确保平台匹配.

我见过缺少主入口点的其他情况,但在这种情况下,所有其他版本都没有问题,只有在 Win32 Relase 版本上会产生此错误,所以我认为我不需要更改任何内容编码。

任何人都可以提供任何线索吗?,我没有想法。任何想法将不胜感激。谢谢。

4

4 回答 4

6

难以置信的!!!

我发现了问题!导致这个严重错误的原因非常简单:“空间”

事实证明,在 Configuration->C/C++->OutputFiles->Object File Name 下:我有:“$(IntDir)\”

直到我非常仔细地注意 Kdiff3 窗口才注意到空格,并注意到这个小下划线表示空格。
这个空间已经存在了几个月,因为这个项目一直无人看管(在我加入之前),因为没有人能找到它的修复方法,所以他们就停止使用它。很可能是复制粘贴错误。

谢谢大家的想法。特别是 Xearinox 的第一个答案让我考虑比较所有模式。我会尝试找一些时间来编写一个工具来将项目/解决方案文件解析为一个 4 列的表格,其中列出了所有配置和平台的所有属性,以便我们可以轻松地比较它们。再次感谢大家。

于 2012-05-16T21:35:15.193 回答
3

Open up your project's settings page, go to LinkerSystem and examine the SubSystem property. Make sure it's set to the same value in all project configurations by switching the configuration from the configuration drop-down box.

Assuming that your intended entry point is main (or one of its variants such as _tmain or wmain), you want to make sure to use the SubSystem property is set to CONSOLE.

于 2012-05-16T04:05:06.133 回答
2

缺少作为入口点的 WinMain。

于 2012-05-16T17:24:35.517 回答
0

就我而言,我试图编译的文件具有错误的属性。

我在文件扩展名中创建了带有杂散字符的文件,因此我的项目给了它错误的 Item Type: Does not participate in build

重命名后,我进入它的属性,并将项目类型更改为<reset to default>,将其重置为C/C++ Compiler

于 2018-01-13T15:27:30.160 回答