为WinCE构建POCO C ++:与winbase.h相关的错误

时间:2016-01-27 21:28:31

标签: c++ c visual-studio windows-ce poco-libraries

我正在尝试使用提供的buildwin.cmd在Windows 7 Pro x64上从Visual Studio 2008命令提示符(VS 9.0 Professional SP1和Windows Embedded Compact 7 ATL更新)构建POCO 1.6.1 C ++库,如下所示:

buildwin 90 build static_mt both WinCE samples

然而,基础库(Foundation_CE_vs90.vcproj)的构建因C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h中的多个错误而失败,显然需要以下文件:

wce_winbase.c
wce_path.c
wce_directorymanagement.c
wce_clock.c

文件wce_rewind.c本身似乎也有些错误 可能会发生一些微不足道的事情,但我无法找到它。这里附加了输出的一些相关部分(目标Beckhoff_HMI_700 (x86)是我感兴趣的Windows Embedded Compact 7设备,其SDK似乎在我的机器上正确配置 - 如果需要,我可以提供更多详细信息)。非常感谢大家。

Setting environment for using Microsoft Visual Studio 2008 x86 tools.


########################################################################
####
#### STARTING VISUAL STUDIO BUILD (vs90, WinCE)
####
########################################################################


The following configurations will be built:
debug_static_mt
release_static_mt

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++ Building [CppUnit_CE_vs90.vcproj]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Microsoft (R) Visual Studio Version 9.0.30729.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: CppUnit, Configuration: debug_static_mt Beckhoff_HMI_700 (x86) ------
1>Compiling...
1>TextTestResult.cpp
1>TestSuite.cpp
1>TestRunner.cpp
1>TestResult.cpp
1>TestFailure.cpp
1>TestDecorator.cpp
1>TestCase.cpp
1>Generating Code...
1>Compiling...
1>CppUnitException.cpp
1>Creating library...
1>Build log was saved at "file://c:\poco-1.6.1\CppUnit\obj\Beckhoff_HMI_700 (x86)\debug_static_mt\BuildLog.htm"
1>CppUnit - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========




Microsoft (R) Visual Studio Version 9.0.30729.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: CppUnit, Configuration: release_static_mt Beckhoff_HMI_700 (x86) ------
1>Compiling...
1>TextTestResult.cpp
1>TestSuite.cpp
1>TestRunner.cpp
1>TestResult.cpp
1>TestFailure.cpp
1>TestDecorator.cpp
1>TestCase.cpp
1>Generating Code...
1>Compiling...
1>CppUnitException.cpp
1>Creating library...
1>Build log was saved at "file://c:\poco-1.6.1\CppUnit\obj\Beckhoff_HMI_700 (x86)\release_static_mt\BuildLog.htm"
1>CppUnit - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========




------------------------------------------------------------------------
------------------------------------------------------------------------
---- Done building [CppUnit_CE_vs90.vcproj]
------------------------------------------------------------------------
------------------------------------------------------------------------


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++ Building [Foundation_CE_vs90.vcproj]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Microsoft (R) Visual Studio Version 9.0.30729.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: Foundation, Configuration: debug_static_mt Beckhoff_HMI_700 (x86) ------
1>Compiling...
1>Base32Decoder.cpp
1>VarIterator.cpp
1>VarHolder.cpp
1>Var.cpp
1>Void.cpp
1>StringTokenizer.cpp
1>DirectoryIteratorStrategy.cpp
1>NumericString.cpp
1>String.cpp
1>SortedDirectoryIterator.cpp
1>RefCountedObject.cpp
1>NumberParser.cpp
1>NumberFormatter.cpp
1>NestedDiagnosticContext.cpp
1>MemoryPool.cpp
1>FPEnvironment.cpp
1>Format.cpp
1>Exception.cpp
1>Error.cpp
1>Environment.cpp
1>Generating Code...
1>Compiling...
1>Debugger.cpp
1>Checksum.cpp
1>ByteOrder.cpp
1>Bugcheck.cpp
1>AtomicCounter.cpp
1>Generating Code...
1>Compiling...
1>wce_winbase.c
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(238) : error C2016: C requires that a struct or union has at least one member
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(238) : error C2061: syntax error : identifier 'ULONG_PTR'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(239) : error C2061: syntax error : identifier 'InternalHigh'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(239) : error C2059: syntax error : ';'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(242) : error C2016: C requires that a struct or union has at least one member
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(242) : error C2061: syntax error : identifier 'DWORD'

[...]

1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(418) : error C2061: syntax error : identifier 'VOID'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(418) : fatal error C1003: error count exceeds 100; stopping compilation
1>wce_unlink.c
1>wce_timesys.c
1>wce_time.c
1>wce_strerror.c
1>wce_stat.c
1>wce_setlocale.c
1>wce_rmdir.c
1>wce_rewind.c
1>.\wcelibcex-1.0\src\wce_rewind.c(64) : error C2143: syntax error : missing ')' before '*'
1>.\wcelibcex-1.0\src\wce_rewind.c(64) : error C2143: syntax error : missing '{' before '*'
1>.\wcelibcex-1.0\src\wce_rewind.c(64) : error C2059: syntax error : ')'
1>.\wcelibcex-1.0\src\wce_rewind.c(65) : error C2054: expected '(' to follow 'fp'
1>wce_rename.c
1>wce_path.c
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(238) : error C2016: C requires that a struct or union has at least one member

[...]

1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(436) : fatal error C1003: error count exceeds 100; stopping compilation
1>wce_mktime.c
1>wce_mkdir.c
1>wce_localtime.c
1>wce_lfind.c
1>wce_gettimeofday.c
1>wce_getopt.c
1>wce_getenv.c
1>wce_findfile.c
1>wce_errno.c
1>Generating Code...
1>Compiling...
1>wce_directorymanagement.c
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(238) : error C2016: C requires that a struct or union has at least one member

[...]

1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(418) : fatal error C1003: error count exceeds 100; stopping compilation
1>wce_ctime.c
1>wce_clock.c
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(238) : error C2016: C requires that a struct or union has at least one member

[...]

1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winbase.h(418) : fatal error C1003: error count exceeds 100; stopping compilation
1>wce_bsearch.c
1>wce_asctime.c
1>.\wcelibcex-1.0\src\wce_asctime.c(124) : warning C4013: 'sprintf' undefined; assuming extern returning int
1>wce_access.c
1>.\wcelibcex-1.0\src\wce_access.c(67) : error C2065: 'SFGAO_READONLY' : undeclared identifier
1>wce_abort.c
1>Generating Code...
1>Compiling...
1>HashStatistic.cpp
1>Hash.cpp
1>EventArgs.cpp
1>TaskNotification.cpp
1>TaskManager.cpp

[...]

1>pcre_exec.c
1>pcre_compile.c
1>Generating Code...
1>Compiling...
1>pcre_chartables.c
1>Generating Code...
1>Compiling...
1>RegularExpression.cpp
1>SharedLibrary.cpp
1>c:\poco-1.6.1\foundation\src\SharedLibrary_WIN32U.cpp(86) : error C3861: 'GetProcAddressW': identifier not found
1>Manifest.cpp
1>SHA1Engine.cpp
1>RandomStream.cpp

[...]

1>Generating Code...
1>Compiling...
1>zutil.c
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(720) : error C2059: syntax error : '('
1>.\src\zutil.c(147) : error C2072: '_errno' : initialization of a function
1>trees.c
1>inftrees.c
1>inflate.c
1>inffast.c

[...]

1>Base64Decoder.cpp
1>Base32Encoder.cpp
1>Generating Code...
1>Build log was saved at "file://c:\poco-1.6.1\Foundation\obj\Foundation\Beckhoff_HMI_700 (x86)\debug_static_mt\BuildLog.htm"
1>Foundation - 416 error(s), 1 warning(s)
2>------ Build started: Project: TestSuite, Configuration: debug_static_mt Beckhoff_HMI_700 (x86) ------
3>------ Build started: Project: TestApp, Configuration: debug_static_mt Beckhoff_HMI_700 (x86) ------
4>------ Build started: Project: TestLibrary, Configuration: debug_static_mt Beckhoff_HMI_700 (x86) ------
3>Compiling...
4>Compiling...
3>TestApp_WINCE.cpp
4>TestLibrary.cpp
2>Compiling...
2>AnyTest.cpp
2>VarTest.cpp
4>TestPlugin.cpp
4>Generating Code...
3>Linking...
4>Linking...
3>LINK : fatal error LNK1181: cannot open input file 'PocoFoundationmtd.lib'
4>LINK : fatal error LNK1181: cannot open input file 'PocoFoundationmtd.lib'
3>Build log was saved at "file://c:\poco-1.6.1\Foundation\testsuite\obj\TestApp\Beckhoff_HMI_700 (x86)\debug_static_mt\BuildLog.htm"
3>TestApp - 1 error(s), 0 warning(s)
4>Build log was saved at "file://c:\poco-1.6.1\Foundation\testsuite\obj\TestLibrary\Beckhoff_HMI_700 (x86)\debug_static_mt\BuildLog.htm"
4>TestLibrary - 1 error(s), 0 warning(s)
2>DynamicTestSuite.cpp
2>SimpleHashTableTest.cpp
2>LinearHashTableTest.cpp
2>HashTableTest.cpp
2>HashSetTest.cpp
1>inffast.c

[...]

2>ByteOrderTest.cpp
2>AutoReleasePoolTest.cpp
2>AutoPtrTest.cpp
2>ArrayTest.cpp
2>Generating Code...
2>Linking...
2>LINK : fatal error LNK1181: cannot open input file 'PocoFoundationmtd.lib'
2>Build log was saved at "file://c:\poco-1.6.1\Foundation\testsuite\obj\TestSuite\Beckhoff_HMI_700 (x86)\debug_static_mt\BuildLog.htm"
2>TestSuite - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX  BUILD FAILED. EXITING. XXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

2 个答案:

答案 0 :(得分:1)

使用SDK或您使用的包含路径时,某些内容已关闭。 CE构建不应该使用winbase.h下的任何内容;这些是桌面Windows SDK的标题。构建使用的c:\Program Files (x86)\Windows CE Tools\SDKs\[platform name]\Include\[architecture]\应来自设备的SDK标头MainWindow.xaml

您应该检查桌面Windows SDK标头是否在包含路径中的某个位置,并相应地删除它们。由于CppUnit似乎正在构建并假设您可以使用相同的设备SDK成功构建其他软件,因此首先要查找它们的是Foundation_CE_vs90.vcproj。

答案 1 :(得分:1)

一种可能性是VC ++目录中存在Windows SDK 6.0A的包含路径。

  1. 在Visual Studio中,转到工具>选项>项目和解决方案> VC ++目录
  2. 在"平台"中选择您的设备平台顶部的下拉框
  3. 选择"包含文件"在"显示目录中"下拉框。
  4. 如果有路径指向Windows 6.0A SDK或任何其他SDK,请将其删除。
  5. 为您的设备添加SDK的路径,即:C:\ Program Files(x86)\ Windows CE Tools \ SDKs \ [您的平台SDK] \包含\ [您的芯片架构] \
  6. SDK目录中可能存在一些差异,因为这取决于SDK安装程序以及您在安装期间的选择。

    如果您安装或使用常规Windows SDK,可能会发生这种情况。这就是发生在我身上的事。

    此外,库文件也可能存在问题。在上面的步骤3中选择"库文件"并进行匹配更改。