编译cygwin的Poco源时出错

时间:2015-02-12 16:29:26

标签: c++ cygwin poco

我为windows下载了poco-1.6-all,我试图为cygwin构建它,我在执行make install后得到这个错误我需要一些帮助,因为我不知道如何解决这个NTDDI_VERSION错误:

$ make install
make -C /cygdrive/c/poco-1.6.0-all/Foundation
make[1]: Entering directory '/cygdrive/c/poco-1.6.0-all/Foundation'
mkdir -p /cygdrive/c/poco-1.6.0-all/Foundation/obj/CYGWIN/x86_64/release_static
mkdir -p /cygdrive/c/poco-1.6.0-all/Foundation/obj/CYGWIN/x86_64/debug_static
mkdir -p /cygdrive/c/poco-1.6.0-all/Foundation/obj/CYGWIN/x86_64/release_shared
mkdir -p /cygdrive/c/poco-1.6.0-all/Foundation/obj/CYGWIN/x86_64/debug_shared
** Compiling src/ArchiveStrategy.cpp (debug, shared)
g++  -Iinclude -I/cygdrive/c/poco-1.6.0-all/CppUnit/include -I/cygdrive/c/poco-1.6.0-all/CppUnit/WinTestRunner/include -I/cygdrive/c/poco-1.6.0-all/Foundation/include -I/cygdrive/c/poco-1.6.0-all/XML/include -I/cygdrive/c/poco-1.6.0-all/JSON/include -I/cygdrive/c/poco-1.6.0-all/Util/include -I/cygdrive/c/poco-1.6.0-all/Net/include -I/cygdrive/c/poco-1.6.0-all/Crypto/include -I/cygdrive/c/poco-1.6.0-all/NetSSL_OpenSSL/include -I/cygdrive/c/poco-1.6.0-all/Data/include -I/cygdrive/c/poco-1.6.0-all/Data/SQLite/include -I/cygdrive/c/poco-1.6.0-all/Data/ODBC/include -I/cygdrive/c/poco-1.6.0-all/Data/MySQL/include -I/cygdrive/c/poco-1.6.0-all/MongoDB/include -I/cygdrive/c/poco-1.6.0-all/Zip/include -I/cygdrive/c/poco-1.6.0-all/PageCompiler/include -I/cygdrive/c/poco-1.6.0-all/PageCompiler/File2Page/include -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY -DPOCO_BUILD_HOST=PB00YCT7  -D_XOPEN_SOURCE=500  -g -D_DEBUG  -c src/ArchiveStrategy.cpp -o /cygdrive/c/poco-1.6.0-all/Foundation/obj/CYGWIN/x86_64/debug_shared/ArchiveStrategy.o
In file included from c:\mingw\include\_mingw.h:35:0,
                 from c:\mingw\include\windows.h:28,
                 from include/Poco/UnWindows.h:90,
                 from include/Poco/Platform_WIN32.h:24,
                 from include/Poco/Foundation.h:102,
                 from include/Poco/ArchiveStrategy.h:23,
                 from src/ArchiveStrategy.cpp:17:
c:\mingw\include\sdkddkver.h:137:8: error: #error The _WIN32_WINNT value does not match NTDDI_VERSION
 #      error The _WIN32_WINNT value does not match NTDDI_VERSION
        ^
In file included from include/Poco/ArchiveStrategy.h:23:0,
                 from src/ArchiveStrategy.cpp:17:
include/Poco/Foundation.h:122:4: error: #error POCO_WIN32_UTF8 and POCO_NO_WSTRING are mutually exclusive.
   #error POCO_WIN32_UTF8 and POCO_NO_WSTRING are mutually exclusive.
    ^
/cygdrive/c/poco-1.6.0-all/build/rules/compile:53: recipe for target '/cygdrive/c/poco-1.6.0-all/Foundation/obj/CYGWIN/x86_64/debug_shared/ArchiveStrategy.o' failed
make[1]: *** [/cygdrive/c/poco-1.6.0-all/Foundation/obj/CYGWIN/x86_64/debug_shared/ArchiveStrategy.o] Error 1
make[1]: Leaving directory '/cygdrive/c/poco-1.6.0-all/Foundation'
Makefile:69: recipe for target 'Foundation-libexec' failed
make: *** [Foundation-libexec] Error 2

这也是我用来编译代码的行:

$ ./configure --config=CYGWIN --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQ --prefix=./_INSTALL
$ make clean
$ make -j4 -nodemos
$ make install

任何有关此错误的帮助都会被贬低,谢谢。

1 个答案:

答案 0 :(得分:2)

由于与Windows操作系统版本相比,MinGW的c:\mingw\include\sdkddkver.h已过时。看一下这个页面:

Using the Windows Headers

并检查某些#define是否未包含在上述文件中。我刚刚使用Windows 8.1并收到了同样的错误。

解决方案可能是使用MinGW的更新版本,例如MinGW-w64或任何Visual Studio version