unresolved uncompress and compress2 symbols when building Qt 5.5.1 with MSVC2015



  • Hi all,

    I am currently struggling with a mistake I get when I am trying to compile Qt 5.5.1 with Visual Studio 2015. Here is my configure call, which works fine :

    configure -nomake examples -nomake tests -no-angle -opengl desktop > configure_output.txt 2>&1
    

    I use jom to build and I call jom clean before to clean the directory, and I systematically get the following mistakes :

    jom: C:\Qt\Qt5.5.1\qt\qtbase\src\tools\rcc\Makefile.Release [..\..\..\bin\rcc.exe] Error 1120
    	F:\SOUP_SOURCE\qt\jom\jom.exe -f Makefile.Release
    	cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -O2 -MD -D_HAS_EXCEPTIONS=0 -MP -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -DUNICODE -DWIN32 -DWIN64 -DQT_RCC -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_BOOTSTRAP_LIB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DNDEBUG -I. -IC:\ICU\include -IC:\PostgreSQL\9.5\include -I. -I..\..\..\include -I..\..\..\include\QtCore -I..\..\..\include\QtXml -I..\..\..\include\QtCore\5.5.1 -I..\..\..\include\QtCore\5.5.1\QtCore -I..\..\..\include\QtXml\5.5.1 -I..\..\..\include\QtXml\5.5.1\QtXml -I..\..\..\mkspecs\win32-msvc2015 -Fo.obj\release\ @F:\TEMP\rcc.obj.28556.16.jom
    rcc.cpp
    	cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -O2 -MD -D_HAS_EXCEPTIONS=0 -MP -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -DUNICODE -DWIN32 -DWIN64 -DQT_RCC -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_BOOTSTRAP_LIB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DNDEBUG -I. -IC:\ICU\include -IC:\PostgreSQL\9.5\include -I. -I..\..\..\include -I..\..\..\include\QtCore -I..\..\..\include\QtXml -I..\..\..\include\QtCore\5.5.1 -I..\..\..\include\QtCore\5.5.1\QtCore -I..\..\..\include\QtXml\5.5.1 -I..\..\..\include\QtXml\5.5.1\QtXml -I..\..\..\mkspecs\win32-msvc2015 -Fo.obj\release\ @F:\TEMP\main.obj.28556.16.jom
    main.cpp
    	link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:..\..\..\bin\rcc.exe @F:\TEMP\rcc.exe.28556.3635.jom
    Qt5Bootstrap.lib(qbytearray.obj) : error LNK2019: unresolved external symbol compress2 referenced in function "class QByteArray __cdecl qCompress(unsigned char const *,int,int)" (?qCompress@@YA?AVQByteArray@@PEBEHH@Z)
    Qt5Bootstrap.lib(qbytearray.obj) : error LNK2019: unresolved external symbol uncompress referenced in function "class QByteArray __cdecl qUncompress(unsigned char const *,int)" (?qUncompress@@YA?AVQByteArray@@PEBEH@Z)
    c:\zlib\lib\zdll.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'
    ..\..\..\bin\rcc.exe : fatal error LNK1120: 2 unresolved externals
    jom: C:\Qt\Qt5.5.1\qt\qtbase\src\tools\rcc\Makefile [release] Error 2
    	link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:..\..\..\bin\moc.exe @F:\TEMP\moc.exe.31360.4321.jom
    Qt5Bootstrap.lib(qbytearray.obj) : error LNK2019: unresolved external symbol compress2 referenced in function "class QByteArray __cdecl qCompress(unsigned char const *,int,int)" (?qCompress@@YA?AVQByteArray@@PEBEHH@Z)
    Qt5Bootstrap.lib(qbytearray.obj) : error LNK2019: unresolved external symbol uncompress referenced in function "class QByteArray __cdecl qUncompress(unsigned char const *,int)" (?qUncompress@@YA?AVQByteArray@@PEBEH@Z)
    c:\zlib\lib\zdll.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'
    ..\..\..\bin\moc.exe : fatal error LNK1120: 2 unresolved externals
    jom: C:\Qt\Qt5.5.1\qt\qtbase\src\tools\moc\Makefile.Release [..\..\..\bin\moc.exe] Error 1120
    jom: C:\Qt\Qt5.5.1\qt\qtbase\src\tools\moc\Makefile [release] Error 2
    jom: C:\Qt\Qt5.5.1\qt\qtbase\src\Makefile [sub-moc-make_first] Error 2
    jom: C:\Qt\Qt5.5.1\qt\qtbase\src\Makefile [sub-rcc-make_first] Error 2
    jom: C:\Qt\Qt5.5.1\qt\qtbase\Makefile [sub-src-make_first] Error 2
    jom: C:\Qt\Qt5.5.1\qt\Makefile [module-qtbase-make_first] Error 2
    
    

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    How did you setup the command line you are using ? It seems you are trying to build a 64bit configured Qt using the 32bit VS compiler.



  • Hi,

    Here is the content of my "starter" prompt :

    CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
    SET _ROOT=c:\Qt\Qt5.5.1\qt
    SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;C:\ICU\bin64;%PATH%
    SET INCLUDE=%INCLUDE%;C:\icu\include;
    SET LIB=%LIB%;C:\icu\lib64;
    SET QMAKESPEC=win32-msvc2015
    SET _ROOT=
    

    Am I missing something ? amd64 should pick the 64bits compiler, right ?


  • Lifetime Qt Champion

    Why do you have Qt and gnuwin32 in your PATH ? That looks suspicious, there's also no need for the QMAKESPEC. It should be automatically detected.

    IIRC, you should have in Visual Studio's Start menu a folder with links to prepared command line, that might help ensure the correct version is used. e.g. with Visual Studio 2013, for 64bit it's a cross-compiling shell that's proposed.



  • About gnuwin32 and Qt in teh path, these instructions are directly coming from Qt documentation : see http://doc.qt.io/qt-5/windows-building.html

    I managed to build Qt with ICU, webkit and all the plugins by using the INCLUDE and LIBS variables in the prompt instead of in the configure call.
    When I started this thread my problem was that Qt kept linking with the system zlib installation, and this was coming from a former configuration that was not correctly cleaned, as the "confclean" nmake target does not work anymore in Qt 5.5.1.
    I deleted the whole directory, unzipped the source again and used the following prompt :

    CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
    SET _ROOT=c:\Qt\Qt5.5.1\qt
    SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;C:\ICU\bin64;c:\Qt\jom;%PATH%
    SET INCLUDE=%INCLUDE%;C:\icu\include;
    SET LIB=%LIB%;C:\icu\lib64;
    SET QMAKESPEC=win32-msvc2015
    SET _ROOT=
    

    with the following configure call :

    configure -prefix c:\Qt\Qt5.5.1\install\ -opensource -confirm-license -debug-and-release -c++11 -nomake examples -nomake tests -icu -no-angle -opengl desktop
    

    Webkit was built automatically as I had perl, python and ruby in my PATH.

    Thanks


  • Lifetime Qt Champion

    Glad you found out and thanks for sharing your findings !

    Thanks for the link, I've forgotten that page.

    What I usually do is an out of source build, so when there's something to change, you can just nuke the build folder and start fresh without to worry about what would need to be cleaned from the source tree.

    Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.