quazip-0-7-3构建在windows上失败



以下是我所做的操作和错误消息:

从下载quazip-0-7-3http://quazip.sourceforge.net/index.html,并将其解压缩到c:\Qt,运行以下命令,最后会得到错误:

C:Qtquazip-0.7.3quazip>where qmake
C:Qt5.10.0msvc2015binqmake.exe
C:Qtquazip-0.7.3quazip>where qmake
C:Qt5.10.0msvc2015binqmake.exe
C:Qtquazip-0.7.3quazip>qmake PREFIX=c:Qtquazip
Info: creating stash file C:Qtquazip-0.7.3quazip.qmake.stash
C:Qtquazip-0.7.3quazip>where make
C:Program Files (x86)GnuWin32binmake.exe
C:Qtquazip-0.7.3quazip>make
make -f Makefile.Release
make[1]: Entering directory `C:/Qt/quazip-0.7.3/quazip'
Makefile.Release:120: *** missing separator.  Stop.
make[1]: Leaving directory `C:/Qt/quazip-0.7.3/quazip'
make: *** [release] Error 2

下面是Makefile。从第115行发布到第155行,第120行是"<<":

.SUFFIXES: .c .cpp .cc .cxx
{release}.cpp{release}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease @<<
$<
<<
{release}.cc{release}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease @<<
$<
<<
{release}.cxx{release}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease @<<
$<
<<
{release}.c{release}.obj::
$(CC) -c $(CFLAGS) $(INCPATH) -Forelease @<<
$<
<<
{.}.cpp{release}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease @<<
$<
<<
{.}.cc{release}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease @<<
$<
<<
{.}.cxx{release}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease @<<
$<
<<
{.}.c{release}.obj::
$(CC) -c $(CFLAGS) $(INCPATH) -Forelease @<<
$<
<<

然后我使用"nmake"而不是"make",但它再次失败,并出现不同的错误:

C:Qtquazip-0.7.3quazip>nmake
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.
"C:Program Files (x86)Microsoft Visual Studio 14.0VCbinnmake.exe" -f Makefile.Release
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.
cl -BxC:Qt5.10.0msvc2015binqmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ....5.10.0msvc2015mkspecsfeaturesdatadummy.cpp 2>NUL >releasemoc_predefs.h
C:Qt5.10.0msvc2015binmoc.exe -DUNICODE -D_UNICODE -DWIN32 -DQUAZIP_BUILD -DNOMINMAX -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -D_WINDLL --compiler-flavor=msvc --include release/moc_predefs.h -IC:/Qt/5.10.0/msvc2015/mkspecs/win32-msvc -IC:/Qt/quazip-0.7.3/quazip -IC:/Qt/quazip-0.7.3/quazip -IC:/Qt/5.10.0/msvc2015/include -IC:/Qt/5.10.0/msvc2015/include/QtCore quagzipfile.h -o releasemoc_quagzipfile.cpp
C:Qt5.10.0msvc2015binmoc.exe -DUNICODE -D_UNICODE -DWIN32 -DQUAZIP_BUILD -DNOMINMAX -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -D_WINDLL --compiler-flavor=msvc --include release/moc_predefs.h -IC:/Qt/5.10.0/msvc2015/mkspecs/win32-msvc -IC:/Qt/quazip-0.7.3/quazip -IC:/Qt/quazip-0.7.3/quazip -IC:/Qt/5.10.0/msvc2015/include -IC:/Qt/5.10.0/msvc2015/include/QtCore quaziodevice.h -o releasemoc_quaziodevice.cpp
C:Qt5.10.0msvc2015binmoc.exe -DUNICODE -D_UNICODE -DWIN32 -DQUAZIP_BUILD -DNOMINMAX -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -D_WINDLL --compiler-flavor=msvc --include release/moc_predefs.h -IC:/Qt/5.10.0/msvc2015/mkspecs/win32-msvc -IC:/Qt/quazip-0.7.3/quazip -IC:/Qt/quazip-0.7.3/quazip -IC:/Qt/5.10.0/msvc2015/include -IC:/Qt/5.10.0/msvc2015/include/QtCore quazipfile.h -o releasemoc_quazipfile.cpp
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -DQUAZIP_BUILD -DNOMINMAX -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -D_WINDLL -I. -I. -I....5.10.0msvc2015include -I....5.10.0msvc2015includeQtCore -Irelease -I....5.10.0msvc2015mkspecswin32-msvc -Forelease @C:UsersyhuangAppDataLocalTempnm402C.tmpqioapi.cpp
.qioapi.cpp(11): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
JlCompress.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quaadler32.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quacrc32.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quagzipfile.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quaziodevice.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazip.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazipdir.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazipfile.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazipfileinfo.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazipnewinfo.cpp
....5.10.0msvc2015includeQtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
Generating Code...
NMAKE : fatal error U1077: '"C:Program Files (x86)Microsoft Visual Studio 14.0
VCbincl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:Program Files (x86)Microsoft Visual Studio 14.0
VCbinnmake.exe"' : return code '0x2'
Stop.

在@hole otter rose的评论后,改为以下步骤,但最后仍然出错-C: \Qt\quazip-0.73\quazip>其中qmakeC: \Qt\5.10.0\msvc2015\bin\qmake.exe

C:Qtquazip-0.7.3quazip>"C:Program Files (x86)Microsoft Visual Studio 14.0Common7Toolsvsvars32.bat"
C:Qtquazip-0.7.3quazip>qmake PREFIX=c:Qtquazip INCPATH+=C:Qtzlib-1.2.11

注意:"zlib-1.2.11"包含quazip项目所需的zlib.h。运行"nmake",我得到以下链接错误:

C:Qtquazip-0.7.3quazip>nmake
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.
"C:Program Files (x86)Microsoft Visual Studio 14.0VCBINnmake.exe" -f Makefile.Release
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -DQUAZIP_BUILD -DNOMINMAX -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -D_WINDLL -I. -I....zlib-1.2.11 -I. -I....5.10.0msvc2015include -I....5.10.0msvc2015includeQtCore -Irelease -I....5.10.0msvc2015mkspecswin32-msvc -Forelease @C:UsersyhuangAppDataLocalTempnm2D8C.tmp
qioapi.cpp
JlCompress.cpp
quaadler32.cpp
quacrc32.cpp
quagzipfile.cpp
quaziodevice.cpp
quazip.cpp
quazipdir.cpp
quazipfile.cpp
Generating Code...
cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -O2 -MD -W3 -w44456 -w44457 -w44458 -DUNICODE -D_UNICODE -DWIN32 -DQUAZIP_BUILD -DNOMINMAX -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -D_WINDLL -I. -I....zlib-1.2.11 -I. -I....5.10.0msvc2015include -I....5.10.0msvc2015includeQtCore -Irelease -I....5.10.0msvc2015mkspecswin32-msvc -Forelease @C:UsersyhuangAppDataLocalTempnm44F3.tmp
unzip.c
zip.c
Generating Code...
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -DQUAZIP_BUILD -DNOMINMAX -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -D_WINDLL -I. -I....zlib-1.2.11 -I. -I....5.10.0msvc2015include -I....5.10.0msvc2015includeQtCore -Irelease -I....5.10.0msvc2015mkspecswin32-msvc -Forelease @C:UsersyhuangAppDataLocalTempnm46E8.tmp
moc_quagzipfile.cpp
moc_quaziodevice.cpp
moc_quazipfile.cpp
Generating Code...
link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /MANIFEST:embed /OUT:releasequazip.dll @C:UsersyhuangAppDataLocalTempnm4ED5.tmp
Creating library releasequazip.lib and object releasequazip.exp
quaadler32.obj : error LNK2019: unresolved external symbol _adler32 referenced in function "public: __thiscall QuaAdler32::QuaAdler32(void)" (??0QuaAdler32@@QAE@XZ)
quacrc32.obj : error LNK2019: unresolved external symbol _crc32 referenced in function "public: __thiscall QuaCrc32::QuaCrc32(void)" (??0QuaCrc32@@QAE@XZ)
unzip.obj : error LNK2001: unresolved external symbol _crc32zip.obj : error LNK2001: unresolved external symbol _crc32
quagzipfile.obj : error LNK2019: unresolved external symbol _gzdopen referencedin function "private: bool __thiscall QuaGzipFilePrivate::open<int>(int,class QFlags<enum QIODevice::OpenModeFlag>,class QString &)" (??$open@H@QuaGzipFilePrivate@@AAE_NHV?$QFlags@W4OpenModeFlag@QIODevice@@@@AAVQString@@@Z)
quagzipfile.obj : error LNK2019: unresolved external symbol _gzread referenced in function "protected: virtual __int64 __thiscall QuaGzipFile::readData(char *,__int64)" (?readData@QuaGzipFile@@MAE_JPAD_J@Z)
quagzipfile.obj : error LNK2019: unresolved external symbol _gzwrite referencedin function "protected: virtual __int64 __thiscall QuaGzipFile::writeData(char const *,__int64)" (?writeData@QuaGzipFile@@MAE_JPBD_J@Z)
quagzipfile.obj : error LNK2019: unresolved external symbol _gzflush referencedin function "public: virtual bool __thiscall QuaGzipFile::flush(void)" (?flush@QuaGzipFile@@UAE_NXZ)
quagzipfile.obj : error LNK2019: unresolved external symbol _gzclose referencedin function "public: virtual __thiscall QuaGzipFile::~QuaGzipFile(void)" (??1QuaGzipFile@@UAE@XZ)
quagzipfile.obj : error LNK2019: unresolved external symbol _gzopen referenced in function "private: bool __thiscall QuaGzipFilePrivate::open<class QString>(class QString,class QFlags<enum QIODevice::OpenModeFlag>,class QString &)" (??$open@VQString@@@QuaGzipFilePrivate@@AAE_NVQString@@V?$QFlags@W4OpenModeFlag@QIODevice@@@@AAV1@@Z)
quaziodevice.obj : error LNK2019: unresolved external symbol _deflate referenced in function "public: virtual bool __thiscall QuaZIODevice::flush(void)" (?flush@QuaZIODevice@@UAE_NXZ)
zip.obj : error LNK2001: unresolved external symbol _deflatequaziodevice.obj : error LNK2019: unresolved external symbol _deflateEnd referenced in function "public: virtual void __thiscall QuaZIODevice::close(void)" (?close@QuaZIODevice@@UAEXXZ)
zip.obj : error LNK2001: unresolved external symbol _deflateEnd
quaziodevice.obj : error LNK2019: unresolved external symbol _inflate referenced in function "protected: virtual __int64 __thiscall QuaZIODevice::readData(char*,__int64)" (?readData@QuaZIODevice@@MAE_JPAD_J@Z)
unzip.obj : error LNK2001: unresolved external symbol _inflatequaziodevice.obj : error LNK2019: unresolved external symbol _inflateEnd referenced in function "public: virtual void __thiscall QuaZIODevice::close(void)" (?close@QuaZIODevice@@UAEXXZ)
unzip.obj : error LNK2001: unresolved external symbol _inflateEnd
quaziodevice.obj : error LNK2019: unresolved external symbol _deflateInit_ referenced in function "public: virtual bool __thiscall QuaZIODevice::open(class QFlags<enum QIODevice::OpenModeFlag>)" (?open@QuaZIODevice@@UAE_NV?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z)
quaziodevice.obj : error LNK2019: unresolved external symbol _inflateInit_ referenced in function "public: virtual bool __thiscall QuaZIODevice::open(class QFlags<enum QIODevice::OpenModeFlag>)" (?open@QuaZIODevice@@UAE_NV?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z)
unzip.obj : error LNK2019: unresolved external symbol _inflateInit2_ referencedin function _unzOpenCurrentFile3
unzip.obj : error LNK2019: unresolved external symbol _get_crc_table referencedin function _unzOpenCurrentFile3
zip.obj : error LNK2001: unresolved external symbol _get_crc_table
zip.obj : error LNK2019: unresolved external symbol _deflateInit2_ referenced in function _zipOpenNewFileInZip4_64releasequazip.dll : fatal error LNK1120: 17 unresolved externals
NMAKE : fatal error U1077: '"C:Program Files (x86)Microsoft Visual Studio 14.0
VCBINlink.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:Program Files (x86)Microsoft Visual Studio 14.0
VCBINnmake.exe"' : return code '0x2'
Stop.

您使用的是Qt的MSVC构建,因此无法使用MinGW的make。

使用nmake时出现的错误表明您尚未设置MSVC生成环境。有关详细信息,请参阅MSVC文档中命令行上的构建C/C++代码。

相关内容

  • 没有找到相关文章

最新更新