简体   繁体   中英

Build POCO C++ for WinCE: winbase.h related errors

I'm trying to build POCO 1.6.1 C++ libraries from Visual Studio 2008 Command Prompt (VS 9.0 Professional SP1 with Windows Embedded Compact 7 ATL Update) on Windows 7 Pro x64 using the provided buildwin.cmd like this:

buildwin 90 build static_mt both WinCE samples

However the build of the Foundation library ( Foundation_CE_vs90.vcproj ) fails due to several errors in C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include\\winbase.h , apparently needed for the following files:

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

The file wce_rewind.c also seems to be somewhat buggy itself.
Something trivial is probably going on but I just can't find it out. Here's attached some relevant part of the output (the target Beckhoff_HMI_700 (x86) is a Windows Embedded Compact 7 device of my interest, whose SDK appears to be correctly configured on my machine - I can provide more detail about that if needed). Many thanks everybody.

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

Something is off with either your SDK or the include paths you are using. A CE build should never use anything under C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include\\ ; these are headers of the desktop Windows SDK. The winbase.h used by your build should be from the device's SDK headers unter c:\\Program Files (x86)\\Windows CE Tools\\SDKs\\[platform name]\\Include\\[architecture]\\ .

You should check whether the desktop Windows SDK headers are somewhere in your include paths and remove them accordingly. Since CppUnit seems to be building correctly and assuming you can successfully build other software with the same device SDK, the first place to look for them would be in Foundation_CE_vs90.vcproj.

One possibility is that an include path exists for the Windows SDK 6.0A in the VC++ Directories.

  1. In Visual Studio go to Tools>Options>Projects and Solutions> VC++ Directories
  2. Select your device platform in the "Platform" drop-down box at the top
  3. Select "Include files" in the "Show directories for" drop-down box.
  4. If there is a path to the Windows 6.0A SDK or any other SDK remove it.
  5. Add the path to the SDK for your device ie:C:\\Program Files (x86)\\Windows CE Tools\\SDKs\\[Your Platform SDK]\\Include\\[Your chip architecture]\\

There may be some variation in the SDK directory as that is dependent on the SDK installer and your choices during install.

This may have happened if you installed or worked on a regular Windows SDK. That is what happened to me.

Also, there may be an issue with the library files as well. In step 3 above choose "Library files" and make matching changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM