3

所有源文件似乎编译正常。MSVC因编译器错误而失败,无需编译任何源码

但是,因为我实现了,我得到一个新的编译器错误:

1>------ Erstellen gestartet: Projekt: OpenLieroX, Konfiguration: Debug Win32 ------ 
1>Der Buildvorgang wurde am 29.03.2012 23:57:39 gestartet. 
1>InitializeBuildStatus: 
1> Aktualisieren des Timestamps von "Debug\OpenLieroX.unsuccessfulbuild". 
1>ClCompile: 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1> Alle Ausgaben sind aktuell. 
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string.h(54): warning RC4011: identifier truncated to '_CRT_SECURE_CPP_OVERLOAD_STANDA' 
1> 
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string.h(76): warning RC4011: identifier truncated to '_CRT_SECURE_CPP_OVERLOAD_SECURE' 
1> 
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\yvals.h(367): warning RC4011: identifier truncated to '_DISABLE_DEPRECATE_STATIC_CPPLI' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(83): warning RC4011: identifier truncated to 'BOOST_NO_CV_VOID_SPECIALIZATION' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(92): warning RC4011: identifier truncated to 'BOOST_NO_LIMITS_COMPILE_TIME_CO' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(102): warning RC4011: identifier truncated to 'BOOST_NO_LONG_LONG_NUMERIC_LIMI' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(117): warning RC4011: identifier truncated to 'BOOST_NO_MS_INT64_NUMERIC_LIMIT' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(133): warning RC4011: identifier truncated to 'BOOST_NO_TEMPLATE_PARTIAL_SPECI' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(134): warning RC4011: identifier truncated to 'BOOST_BCB_PARTIAL_SPECIALIZATIO' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(141): warning RC4011: identifier truncated to 'BOOST_NO_TEMPLATE_PARTIAL_SPECI' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(142): warning RC4011: identifier truncated to 'BOOST_NO_ARRAY_TYPE_SPECIALIZAT' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(149): warning RC4011: identifier truncated to 'BOOST_NO_TEMPLATE_PARTIAL_SPECI' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(158): warning RC4011: identifier truncated to 'BOOST_NO_TEMPLATE_PARTIAL_SPECI' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(159): warning RC4011: identifier truncated to 'BOOST_NO_PARTIAL_SPECIALIZATION' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(169): warning RC4011: identifier truncated to 'BOOST_NO_TEMPLATED_ITERATOR_CON' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(186): warning RC4011: identifier truncated to 'BOOST_NO_ARGUMENT_DEPENDENT_LOO' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(186): warning RC4011: identifier truncated to 'BOOST_FUNCTION_SCOPE_USING_DECL' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(341): warning RC4011: identifier truncated to 'BOOST_NO_0X_HDR_INITIALIZER_LIS' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(344): warning RC4011: identifier truncated to 'BOOST_NO_0X_HDR_INITIALIZER_LIS' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/config/suffix.hpp(566): warning RC4011: identifier truncated to 'BOOST_NO_EXPLICIT_FUNCTION_TEMP' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/limits.hpp(22): warning RC4011: identifier truncated to 'BOOST_NO_LONG_LONG_NUMERIC_LIMI' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/limits.hpp(23): warning RC4011: identifier truncated to 'BOOST_NO_MS_INT64_NUMERIC_LIMIT' 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/cstdint.hpp(300): error RC2177: constant too big 
1> 
1>C:\Program Files (x86)\boost\boost_1_47\boost/cstdint.hpp(300): fatal error RC1012: mismatched parenthesis : missing ' 
1> 
1>Fehler beim Erstellen 

我真的不明白,为什么我明白了。也不是来自哪个源文件,因为它不再编译任何源文件(因为所有文件都已成功编译)。

+2

你为什么要用资源编译器编译普通代码? – ildjarn 2012-03-29 22:08:49

+0

哪些头文件直接包含在您编译的RC文件中? – Oleg 2012-03-29 22:09:14

+1

@ildjarn:感谢关于资源编译器的提示。就是这样。 (它包括一些其他源文件,以使版本宏保持不变。)(你应该把它变成一个真正的答案......) – Albert 2012-03-29 22:54:10

回答

5

(从评论转贴这样的问题可以被标记回答。)

你不应该编译正常的代码与资源编译器。

2

虽然明显答案就在这里已经是正确的一些背景: 的MSVC资源编译器在焦炭截断也会发生与更新的系统头像那些从VC10或更高版本已宏名超过规定31 类似问题的宏名31个字符。另见M $的回答谁只是这个叫‘设计’,而不是固定的RC.EXE:

http://connect.microsoft.com/VisualStudio/feedback/details/532929/rc4011-warnings-from-vc10-rc

受影响的系统头与宏名超过31个字符是因为VC10 string.h中,TCHAR .H,wchar.h,yvals.h,可能有一些更多... 还看到:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/ea289832-c48c-475b-a922-bf94d2ee54e4/vs2012-update-1-fatal-error-rc10056-in-c-project-when-v110xp-platform-is-chosen

+0

有什么办法可以解决这个问题吗?编译BLAT(开源)我得到“wchar.h(1018):致命错误RC10056”错误。任何修补程序? – Maverick 2016-06-14 17:39:42

0

当尝试使用Visual Studio 2013年编译Windows XP和POS准备2009年的目标,我遇到了类似的问题。编译细跟在Platform Toolset配置属性的标准Visual Studio 2013 (v120)设置应用程序然而,当改为Visual Studio 2013 - Windows XP (v120_xp)以适用于Windows XP,我收到的编译错误:

>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\winsock2.h(2752): fatal error RC10056: 

跳转到的位置在WinSock2.h包括文件显示一个函数原型,它使用宏__out_bcount_part_opt()

看到这篇文章后,我意识到错误是一个资源编译器错误。进一步看,我发现头文件piflocal.h包含在源代码和资源文件中都包含WinSock2.h头文件。

换句话说,应用程序源代码有一个头文件piflocal.h,它包含资源文件pif.rc使用的头文件resource.h所需的定义以及C源文件。 piflocal.h中的一些定义需要来自Microsoft标准头文件WinSock2.h的定义,因此WinSock2.h文件被包含在piflocal.h中使其可用。但是,当资源编译器作为拉入各种头文件的一部分尝试处理WinSock2.h文件作为处理piflocal.h的一部分时,它会遇到__out_bcount_part_opt()宏并失败。

我那么做了必要的源代码更改resource.hpiflocal.h头文件,以便通过pif.rcpiflocal.h需要一些定义移入resource.h和头文件piflocal.h不再包含或由资源编译器时被拉入编译pif.rc

通过从资源编译器拉入的头文件列表中删除WinSock2.h,错误不再发生。

我不知道为什么使用标准的Visual Studio 2013设置进行编译,并针对Windows XP及其变体进行失败。

结论:,如果你正在运行到这个错误或类似的错误,更可能要包括到资源编译器宏定义是与资源编译器不兼容的头文件。