I tried to compile Qt+Webkit statically with MS VS 2008 and this worked.
C:\Qt\4.6.2>configure -release -static -opensource -no-fast -no-exceptions -no-accessibility -no-rtti -no-stl -no-opengl -no-openvg -no-incredibuild-xge -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-style-windowsce -no-style-windowsmobile -no-style-s60 -no-gif -no-libpng -no-libtiff -no-libjpeg -no-libmng -no-qt3support -no-mmx -no-3dnow -no-sse -no-sse2 -no-iwmmxt -no-openssl -no-dbus -platform win32-msvc2008 -arch windows -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-script -no-scripttools -webkit -no-declarative
However, I get these errors whenever building a project that links statically to QWebKit:
1> Creating library C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.lib and object C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exp
1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _VerQueryValueW#16 referenced in function "class WebCore::String __cdecl WebCore::getVersionInfo(void * const,class WebCore::String const &)" (?getVersionInfo#WebCore##YA?AVString#1#QAXABV21##Z)
1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoW#16 referenced in function "private: bool __thiscall WebCore::PluginPackage::fetchInfo(void)" (?fetchInfo#PluginPackage#WebCore##AAE_NXZ)
1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoSizeW#8 referenced in function "private: bool __thiscall WebCore::PluginPackage::fetchInfo(void)" (?fetchInfo#PluginPackage#WebCore##AAE_NXZ)
1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol _imp_PathRemoveFileSpecW#4 referenced in function "class WebCore::String __cdecl WebCore::safariPluginsDirectory(void)" (?safariPluginsDirectory#WebCore##YA?AVString#1#XZ)
1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol _imp_SHGetValueW#24 referenced in function "void __cdecl WebCore::addWindowsMediaPlayerPluginDirectory(class WTF::Vector &)" (?addWindowsMediaPlayerPluginDirectory#WebCore##YAXAAV?$Vector#VString#WebCore##$0A##WTF###Z)
1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol _imp_PathCombineW#12 referenced in function "void __cdecl WebCore::addMacromediaPluginDirectories(class WTF::Vector &)" (?addMacromediaPluginDirectories#WebCore##YAXAAV?$Vector#VString#WebCore##$0A##WTF###Z)
1>C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exe : fatal error LNK1120: 6 unresolved externals
Do I need to check something in the Qt project options? I have QtCore, QtGui, Network and WebKit checked.
It looks like you need to link in the windows .lib files for each of the missing functions:
VerQueryValue,GetFileVersionInfo -> version.lib
GetFileVersionInfoSize -> Coredll.lib
PathRemoveFileSpec, SHGetValue, PathCombine -> shlwapi.lib
If you are using qmake, you add:
LIBS += -lversion -lCoredll -lshlwapi
Otherwise: From the Project menu, choose Properties. Open Configuration Properties->Linker->Input. In the Additional Dependencies field, add version.lib, Coredll.lib and shlwapi.lib
Related
I was working on a QT program including libtorch and opencv which was compiling without any error in my previous Ubuntu 21.04.
The libtorch library locates at /home/user/Downloads/libtorch and OpenCV installed with the following command:
apt install python3-opencv libopencv-dev libdc1394-22-dev
After upgrading my OS to Ubuntu jammy (22.04), building that program returns the following errors:
warning: libicui18n.so.67, needed by /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3, not found (try using -rpath or -rpath-link)
warning: libicuuc.so.67, needed by /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3, not found (try using -rpath or -rpath-link)
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_getDSTSavings_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_setMillis_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_strcoll_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_open_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `u_strToUpper_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_getTimeZoneDisplayName_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `uenum_close_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_getSortKey_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_get_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_getDefaultTimeZone_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_openTimeZones_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_close_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `u_strToLower_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `uenum_next_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_close_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucol_setAttribute_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_inDaylightTime_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_clone_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_open_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_openTimeZoneIDEnumeration_67'
error: /usr/local/Qt-6.2.3/lib/libQt6Core.so.6.2.3: undefined reference to `ucal_openCountryTimeZones_67'
error: collect2: error: ld returned 1 exit status
error: [CMakeFiles/example.dir/build.make:234: bina] Error 1
CMakeLists.txt is as following code:
cmake_minimum_required(VERSION 3.5)
project(example LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_PREFIX_PATH /home/user/Downloads/libtorch)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets LinguistTools REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets LinguistTools REQUIRED)
find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
set(TS_FILES example_en_US.ts)
set(PROJECT_SOURCES
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
torchtestdlg.cpp
classification.cpp
${TS_FILES}
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(example
${PROJECT_SOURCES}
)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
else()
if(ANDROID)
add_library(example SHARED
${PROJECT_SOURCES}
)
else()
add_executable(example
${PROJECT_SOURCES}
)
endif()
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
endif()
target_link_libraries(example PRIVATE Qt${QT_VERSION_MAJOR}::Widgets ${TORCH_LIBRARIES} ${OpenCV_LIBS})
Obviously it means that it has unresolved symbols which I couldn't understand what symbols they are.
The following is what I did and the error message:
downloads quazip-0-7-3 from http://quazip.sourceforge.net/index.html, and unzip it to c:\Qt, run the following commands and it gets the error at the end:
C:\Qt\quazip-0.7.3\quazip>where qmake
C:\Qt\5.10.0\msvc2015\bin\qmake.exe
C:\Qt\quazip-0.7.3\quazip>where qmake
C:\Qt\5.10.0\msvc2015\bin\qmake.exe
C:\Qt\quazip-0.7.3\quazip>qmake PREFIX=c:\Qt\quazip
Info: creating stash file C:\Qt\quazip-0.7.3\quazip\.qmake.stash
C:\Qt\quazip-0.7.3\quazip>where make
C:\Program Files (x86)\GnuWin32\bin\make.exe
C:\Qt\quazip-0.7.3\quazip>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
The following is the Makefile.Release from line 115 to 155, line 120 is "<<":
.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\ #<<
$<
<<
Then I use the 'nmake' instead of 'make', but it fails again with different error:
C:\Qt\quazip-0.7.3\quazip>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.0\VC\bin\nmake.exe" -f Makefile.Release
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
cl -BxC:\Qt\5.10.0\msvc2015\bin\qmake.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.0\msvc2015\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h
C:\Qt\5.10.0\msvc2015\bin\moc.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 release\moc_quagzipfile.cpp
C:\Qt\5.10.0\msvc2015\bin\moc.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 release\moc_quaziodevice.cpp
C:\Qt\5.10.0\msvc2015\bin\moc.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 release\moc_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.0\msvc2015\include -I..\..\5.10.0\msvc2015\include\QtCore -Irelease -I..\..\5.10.0\msvc2015\mkspecs\win32-msvc -Forelease\ #C:\Users\yhuang\AppData\Local\Temp\nm402C.tmpqioapi.cpp
.\qioapi.cpp(11): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
JlCompress.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quaadler32.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quacrc32.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quagzipfile.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quaziodevice.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazip.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazipdir.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazipfile.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazipfileinfo.cpp
..\..\5.10.0\msvc2015\include\QtCore/qglobal.h(45): fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
quazipnewinfo.cpp
..\..\5.10.0\msvc2015\include\QtCore/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
\VC\bin\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0
\VC\bin\nmake.exe"' : return code '0x2'
Stop.
Change to the following steps after #hole-otter-rosy's comment, and still got error at the end -
C:\Qt\quazip-0.7.3\quazip>where qmake
C:\Qt\5.10.0\msvc2015\bin\qmake.exe
C:\Qt\quazip-0.7.3\quazip>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat"
C:\Qt\quazip-0.7.3\quazip>qmake PREFIX=c:\Qt\quazip INCPATH+=C:\Qt\zlib-1.2.11
NOTE: the 'zlib-1.2.11' contains the zlib.h which is required by quazip project.
run 'nmake' and I got the following link error:
C:\Qt\quazip-0.7.3\quazip>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.0\VC\BIN\nmake.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.0\msvc2015\include -I..\..\5.10.0\msvc2015\include\QtCore -Irelease -I..\..\5.10.0\msvc2015\mkspecs\win32-msvc -Forelease\ #C:\Users\yhuang\AppData\Local\Temp\nm2D8C.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.0\msvc2015\include -I..\..\5.10.0\msvc2015\include\QtCore -Irelease -I..\..\5.10.0\msvc2015\mkspecs\win32-msvc -Forelease\ #C:\Users\yhuang\AppData\Local\Temp\nm44F3.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.0\msvc2015\include -I..\..\5.10.0\msvc2015\include\QtCore -Irelease -I..\..\5.10.0\msvc2015\mkspecs\win32-msvc -Forelease\ #C:\Users\yhuang\AppData\Local\Temp\nm46E8.tmp
moc_quagzipfile.cpp
moc_quaziodevice.cpp
moc_quazipfile.cpp
Generating Code...
link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /MANIFEST:embed /OUT:release\quazip.dll #C:\Users\yhuang\AppData\Local\Temp\nm4ED5.tmp
Creating library release\quazip.lib and object release\quazip.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_64release\quazip.dll : fatal error LNK1120: 17 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0
\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
You are using an MSVC build of Qt and thus cannot use MinGW's make.
The error you get when using nmake indicates that you haven't set up a MSVC build environent. See Build C/C++ code on the command line in the MSVC docs for more information.
I'm trying to build qt3d libraries in QtCreator with msvc2013. I'm following the qt3d installation steps, but I'm getting linking error:
cl -c -nologo -Zm200 -Zc:wchar_t -FS -O2 -MD -Zc:strictStrings -EHsc -GR -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_BUILD_3D_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DQT_NO_EGL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DNDEBUG -I"..\..\include" -I"..\..\include\Qt3D" -I"..\..\include\Qt3D\5.3.0" -I"..\..\include\Qt3D\5.3.0\Qt3D" -I"tmp" -I"..\private" -I"global" -I"painting" -I"arrays" -I"effects" -I"materials" -I"geometry" -I"viewing" -I"math3d" -I"scene" -I"scene_ai" -I"..\..\3rdparty\assimp" -I"..\..\3rdparty\assimp\code" -I"..\..\3rdparty\assimp\code\BoostWorkaround" -I"..\..\3rdparty\assimp\include" -I"..\..\3rdparty\assimp\include\Compiler" -I"..\..\3rdparty\assimp\contrib\ConvertUTF" -I"..\..\3rdparty\assimp\contrib\zlib" -I"..\..\3rdparty\assimp\contrib\irrXML" -I"..\..\3rdparty\assimp\contrib\unzip" -I"scene_bezier" -I"network" -I"graphicsview" -I"textures" -I"surfaces" -I"api" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtCore\5.4.0" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtCore\5.4.0\QtCore" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtGui\5.4.0" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtGui\5.4.0\QtGui" -I"C:\Qt\5.4_angle\5.4\msvc2013\include" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtOpenGL" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtWidgets" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtGui" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtANGLE" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtCore" -I"C:\Qt\5.4_angle\5.4\msvc2013\include\QtNetwork" -I".moc\release" -I"C:\Qt\5.4_angle\5.4\msvc2013\mkspecs\win32-msvc2013" -Fo.obj\release\ #C:\Users\eDS\AppData\Local\Temp\moc_qgltexture2d_p.obj.696.166609.jom
moc_qgltexture2d_p.cpp
link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.30 /MANIFEST:embed /OUT:..\..\lib\Qt53D.dll #C:\Users\eDS\AppData\Local\Temp\Qt53D.dll.696.168263.jom
Creating library ..\..\lib\Qt53D.lib and object ..\..\lib\Qt53D.exp
qglpainter.obj : error LNK2019: unresolved external symbol __imp__glColor4f#16 referenced in function "public: void __thiscall QGLPainter::updateFixedFunction(class QFlags<enum QGLPainter::Update>)" (?updateFixedFunction#QGLPainter##QAEXV?$QFlags#W4Update#QGLPainter#####Z)
qglpainter.obj : error LNK2019: unresolved external symbol __imp__glColorPointer#16 referenced in function "void __cdecl qt_gl_setVertexAttribute(enum QGL::VertexAttribute,class QGLAttributeValue const &)" (?qt_gl_setVertexAttribute##YAXW4VertexAttribute#QGL##ABVQGLAttributeValue###Z)
qglpainter.obj : error LNK2019: unresolved external symbol __imp__glLightModelfv#8 referenced in function "public: void __thiscall QGLPainter::updateFixedFunction(class QFlags<enum QGLPainter::Update>)" (?updateFixedFunction#QGLPainter##QAEXV?$QFlags#W4Update#QGLPainter#####Z)
qglpainter.obj : error LNK2019: unresolved external symbol __imp__glLightfv#12 referenced in function "void __cdecl setLight(int,class QGLLightParameters const *,class QMatrix4x4 const &)" (?setLight##YAXHPBVQGLLightParameters##ABVQMatrix4x4###Z)
qglpainter.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity#0 referenced in function "public: void __thiscall QGLPainter::updateFixedFunction(class QFlags<enum QGLPainter::Update>)" (?updateFixedFunction#QGLPainter##QAEXV?$QFlags#W4Update#QGLPainter#####Z)
....
....//continues
please any ideas?
So I'm trying to install QtLocation.
I created the qt5vars.cmd in C:\QT exactly with the text stated.
This is my error:
C:\QT\QT5>REM Set up \Microsoft Visual Studio 2013, where <arch> is \c
amd64, \c x86, etc.
The syntax of the command is incorrect.
C:\QT\QT5>CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\
vcvarsall.bat" <arch>
C:\QT\QT5>configure -debug -nomake examples -opensource
'configure' is not recognized as an internal or external command,
operable program or batch file.
C:\QT\QT5>
Can anyone point me to the problem? I just installed Microsoft Visual studio and it is located in
C:\Program Files (x86)\Microsoft Visual Studio 12.0
Edit: Found out that the problem was that I needed to add x86, besides only the complete backage consists of the make and configure so therefor I downloaded the complete package.
Now I have a new error
moc_qqmlenginedebugservice_p.cpp
moc_qdebugmessageservice_p.cpp
moc_qv4debugservice_p.cpp
moc_qqmlconfigurabledebugservice_p.cpp
moc_qqmlabstractprofileradapter_p.cpp
moc_qv4profileradapter_p.cpp
moc_qqmlprofiler_p.cpp
moc_qabstractanimationjob_p.cpp
moc_qqmlbind_p.cpp
moc_qqmlconnections_p.cpp
moc_qqmldelegatemodel_p.cpp
moc_qqmldelegatemodel_p_p.cpp
moc_qqmllistmodel_p.cpp
moc_qqmllistmodel_p_p.cpp
moc_qqmllistmodelworkeragent_p.cpp
moc_qqmlobjectmodel_p.cpp
moc_qqmltimer_p.cpp
moc_qquickpackage_p.cpp
moc_qquickworkerscript_p.cpp
Generating Code...
link /NOLOGO /DYNAMICBASE /NXCOMPAT /BASE:0x66000000 /DEBUG /DLL /SUBSYS
TEM:WINDOWS /VERSION:5.40 /MANIFEST:embed /OUT:C:\TUecomotive\QT5\qt-everywhere-
opensource-src-5.4.0\qtbase\lib\Qt5Qmld.dll #C:\Users\s130031\AppData\Local\Temp
\nm9C7.tmp
Creating library C:\TUecomotive\QT5\qt-everywhere-opensource-src-5.4.0\qtbase
\lib\Qt5Qmld.lib and object C:\TUecomotive\QT5\qt-everywhere-opensource-src-5.4.
0\qtbase\lib\Qt5Qmld.exp
YarrInterpreter.obj : error LNK2019: unresolved external symbol "struct JSC::Yar
r::CharacterClass * __cdecl JSC::Yarr::newlineCreate(void)" (?newlineCreate#Yarr
#JSC##YAPAUCharacterClass#12#XZ) referenced in function "public: struct JSC::Yar
r::CharacterClass * __thiscall JSC::Yarr::YarrPattern::newlineCharacterClass(voi
d)" (?newlineCharacterClass#YarrPattern#Yarr#JSC##QAEPAUCharacterClass#23#XZ)
YarrPattern.obj : error LNK2001: unresolved external symbol "struct JSC::Yarr::C
haracterClass * __cdecl JSC::Yarr::newlineCreate(void)" (?newlineCreate#Yarr#JSC
##YAPAUCharacterClass#12#XZ)
YarrInterpreter.obj : error LNK2019: unresolved external symbol "struct JSC::Yar
r::CharacterClass * __cdecl JSC::Yarr::wordcharCreate(void)" (?wordcharCreate#Ya
rr#JSC##YAPAUCharacterClass#12#XZ) referenced in function "public: struct JSC::Y
arr::CharacterClass * __thiscall JSC::Yarr::YarrPattern::wordcharCharacterClass(
void)" (?wordcharCharacterClass#YarrPattern#Yarr#JSC##QAEPAUCharacterClass#23#XZ
)
YarrPattern.obj : error LNK2001: unresolved external symbol "struct JSC::Yarr::C
haracterClass * __cdecl JSC::Yarr::wordcharCreate(void)" (?wordcharCreate#Yarr#J
SC##YAPAUCharacterClass#12#XZ)
YarrPattern.obj : error LNK2019: unresolved external symbol "struct JSC::Yarr::C
haracterClass * __cdecl JSC::Yarr::digitsCreate(void)" (?digitsCreate#Yarr#JSC##
YAPAUCharacterClass#12#XZ) referenced in function "public: struct JSC::Yarr::Cha
racterClass * __thiscall JSC::Yarr::YarrPattern::digitsCharacterClass(void)" (?d
igitsCharacterClass#YarrPattern#Yarr#JSC##QAEPAUCharacterClass#23#XZ)
YarrPattern.obj : error LNK2019: unresolved external symbol "struct JSC::Yarr::C
haracterClass * __cdecl JSC::Yarr::spacesCreate(void)" (?spacesCreate#Yarr#JSC##
YAPAUCharacterClass#12#XZ) referenced in function "public: struct JSC::Yarr::Cha
racterClass * __thiscall JSC::Yarr::YarrPattern::spacesCharacterClass(void)" (?s
pacesCharacterClass#YarrPattern#Yarr#JSC##QAEPAUCharacterClass#23#XZ)
YarrPattern.obj : error LNK2019: unresolved external symbol "struct JSC::Yarr::C
haracterClass * __cdecl JSC::Yarr::nondigitsCreate(void)" (?nondigitsCreate#Yarr
#JSC##YAPAUCharacterClass#12#XZ) referenced in function "public: struct JSC::Yar
r::CharacterClass * __thiscall JSC::Yarr::YarrPattern::nondigitsCharacterClass(v
oid)" (?nondigitsCharacterClass#YarrPattern#Yarr#JSC##QAEPAUCharacterClass#23#XZ
)
YarrPattern.obj : error LNK2019: unresolved external symbol "struct JSC::Yarr::C
haracterClass * __cdecl JSC::Yarr::nonspacesCreate(void)" (?nonspacesCreate#Yarr
#JSC##YAPAUCharacterClass#12#XZ) referenced in function "public: struct JSC::Yar
r::CharacterClass * __thiscall JSC::Yarr::YarrPattern::nonspacesCharacterClass(v
oid)" (?nonspacesCharacterClass#YarrPattern#Yarr#JSC##QAEPAUCharacterClass#23#XZ
)
YarrPattern.obj : error LNK2019: unresolved external symbol "struct JSC::Yarr::C
haracterClass * __cdecl JSC::Yarr::nonwordcharCreate(void)" (?nonwordcharCreate#
Yarr#JSC##YAPAUCharacterClass#12#XZ) referenced in function "public: struct JSC:
:Yarr::CharacterClass * __thiscall JSC::Yarr::YarrPattern::nonwordcharCharacterC
lass(void)" (?nonwordcharCharacterClass#YarrPattern#Yarr#JSC##QAEPAUCharacterCla
ss#23#XZ)
C:\TUecomotive\QT5\qt-everywhere-opensource-src-5.4.0\qtbase\lib\Qt5Qmld.dll : f
atal error LNK1120: 7 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
C:\QT\QT5\qt-everywhere-opensource-src-5.4.0>
I had the same problem. I found the answer here Build Qt 5.4 in windows: use VS2010 and here Unresolved external symbol attempting to build 5.2.
To solve this problem:
Check the file QT_HOME\qtdeclarative\src\qml\RegExpJitTables.h is empty or not. If it is empty, delete it. (In later versions the file is situated in each of the subdirectories of QT_HOME\qtdeclarative\src\qml\.generated\ directory.)
make sure that python is in your PATH
nmake
It works for me.
I created a simple GUI application in QtCreator (QT 4.8.2) and added a function to check the network connectivity:
bool MainWindow::CheckNetworkConnectivity()
{
QList<QNetworkInterface> interface = QNetworkInterface::allInterfaces();
for(int i = 0; i < interface.count();i++)
{
QNetworkInterface inface = interface.at(i);
if(inface.IsUp && !inface.IsLoopBack)
{
ui->lstLog->addItem(inface.name()+QDateTime::currentDateTime().toString("h:m:s ap"));
ui->chkConStatus->setChecked(true);
}
else{
ui->chkConStatus->setChecked(false);
}
}
return ui->chkConStatus->checkState();
}
After that any attempts to compile the code generates the following errors:
15:21:11: Running steps for project MasterVPN...
15:21:11: Configuration unchanged, skipping qmake step.
15:21:11: Starting: "C:\Qt\Designer\bin\jom.exe"
C:\Qt\Designer\bin\jom.exe -f Makefile.Debug
cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\Qt\4.8.2\include\QtCore" -I"c:\Qt\4.8.2\include\QtGui" -I"c:\Qt\4.8.2\include" -I"c:\Qt\4.8.2\include\ActiveQt" -I"debug" -I"." -I"..\MasterVPN" -I"." -I"c:\Qt\4.8.2\mkspecs\win32-msvc2010" -Fodebug\ #C:\Users\Master\AppData\Local\Temp\mainwindow.obj.4156.31.jom
mainwindow.cpp
link /LIBPATH:"c:\Qt\4.8.2\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /MANIFEST /MANIFESTFILE:"debug\MasterVPN.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\MasterVPN.exe #C:\Users\Master\AppData\Local\Temp\MasterVPN.exe.4156.5422.jom
mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QNetworkInterface::~QNetworkInterface(void)" (__imp_??1QNetworkInterface##QAE#XZ) referenced in function "public: bool __thiscall MainWindow::CheckNetworkConnectivity(void)" (?CheckNetworkConnectivity#MainWindow##QAE_NXZ)
mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QNetworkInterface::name(void)const " (__imp_?name#QNetworkInterface##QBE?AVQString##XZ) referenced in function "public: bool __thiscall MainWindow::CheckNetworkConnectivity(void)" (?CheckNetworkConnectivity#MainWindow##QAE_NXZ)
mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QNetworkInterface::QNetworkInterface(class QNetworkInterface const &)" (__imp_??0QNetworkInterface##QAE#ABV0##Z) referenced in function "public: bool __thiscall MainWindow::CheckNetworkConnectivity(void)" (?CheckNetworkConnectivity#MainWindow##QAE_NXZ)
mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QList<class QNetworkInterface> __cdecl QNetworkInterface::allInterfaces(void)" (__imp_?allInterfaces#QNetworkInterface##SA?AV?$QList#VQNetworkInterface####XZ) referenced in function "public: bool __thiscall MainWindow::CheckNetworkConnectivity(void)" (?CheckNetworkConnectivity#MainWindow##QAE_NXZ)
debug\MasterVPN.exe : fatal error LNK1120: 4 unresolved externals
jom: C:\Users\Master\Documents\Qt\MasterVPN-build-desktop-Qt_4_8_2__4_8_2__Debug\Makefile.Debug [debug\MasterVPN.exe] Error 1120
jom: C:\Users\Master\Documents\Qt\MasterVPN-build-desktop-Qt_4_8_2__4_8_2__Debug\Makefile [debug] Error 2
15:21:17: The process "C:\Qt\Designer\bin\jom.exe" exited with code 2.
Error while building/deploying project MasterVPN (target: Desktop)
When executing step 'Make'
Can someone please point out what the cause could be?
The linker is indicating that is can not find the required functionality. This is contained within QtNetwork4.lib (if you're on a Windows platform) or the equivalent library for your platform. So you have to tell the linker that it needs to link against this library. The network module is the required one, so instead of just
QT += core gui
at least make that
QT += core gui network
That should fix the linker errors you see.