Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt 5.6.2 ignores additional libraries, while building it from source
QtWS25 Last Chance

Qt 5.6.2 ignores additional libraries, while building it from source

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
3 Posts 2 Posters 759 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SourCreamAndOnion
    wrote on last edited by
    #1

    'm trying to build telegram from source on windows 10, with visual studio 2017, following the official manual from github:

    https://github.com/telegramdesktop/tdesktop/blob/dev/docs/building-msvc.md

    Telegram uses qt 5.6.2 But i stuck on almost last step, qt build. I have built all dependencies prior to that, lzma, zlib,ffmeg etc. The first trouble i ran into, zlib was not found by qt, but i managed to fix with -system-zlib switch. So i have ended up with a command like this

    q:\tg_build\Libraries\qt5_6_2\qtbase>configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\Release\include Q:\tg_build\Libraries\lzma\C" -L "Q:\tg_build\Libraries\lzma\C\Util\LzmaLib\Debug" -l "LzmaLib.lib" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\Debug\lib\ssleay32.lib %cd%\..\openssl\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\Release\lib\ssleay32.lib %cd%\..\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015
    

    After compilation command with jom -j4, i get errors, while linking:

    link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /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 @C:\Users\q\AppData\Local\Temp\moc.exe.10616.2937.jom
    QtBootstrapd.lib(qbytearray.obj) : error LNK2019: ссылка на неразрешенный внешний символ _z_compress2 в функции "class QByteArray __cdecl qCompress(unsigned char const *,int,int)" (?qCompress@@YA?AVQByteArray@@PBEHH@Z)
    QtBootstrapd.lib(qbytearray.obj) : error LNK2019: ссылка на неразрешенный внешний символ _z_uncompress в функции "class QByteArray __cdecl qUncompress(unsigned char const *,int)" (?qUncompress@@YA?AVQByteArray@@PBEH@Z)
    ..\..\..\bin\moc.exe : fatal error LNK1120: неразрешенных внешних элементов: 2
    

    So qt doesn't pick up LZMA. Even though, the configure outputs me:

    Additional libraries........-LQ:\tg_build\Libraries\lzma\C\Util\LzmaLib\Debug -lLzmaLib.lib
    
    
    

    How can i tell qt to pick up and link lzma library then?

    jsulmJ 1 Reply Last reply
    0
    • S SourCreamAndOnion

      'm trying to build telegram from source on windows 10, with visual studio 2017, following the official manual from github:

      https://github.com/telegramdesktop/tdesktop/blob/dev/docs/building-msvc.md

      Telegram uses qt 5.6.2 But i stuck on almost last step, qt build. I have built all dependencies prior to that, lzma, zlib,ffmeg etc. The first trouble i ran into, zlib was not found by qt, but i managed to fix with -system-zlib switch. So i have ended up with a command like this

      q:\tg_build\Libraries\qt5_6_2\qtbase>configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\Release\include Q:\tg_build\Libraries\lzma\C" -L "Q:\tg_build\Libraries\lzma\C\Util\LzmaLib\Debug" -l "LzmaLib.lib" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\Debug\lib\ssleay32.lib %cd%\..\openssl\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\Release\lib\ssleay32.lib %cd%\..\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015
      

      After compilation command with jom -j4, i get errors, while linking:

      link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /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 @C:\Users\q\AppData\Local\Temp\moc.exe.10616.2937.jom
      QtBootstrapd.lib(qbytearray.obj) : error LNK2019: ссылка на неразрешенный внешний символ _z_compress2 в функции "class QByteArray __cdecl qCompress(unsigned char const *,int,int)" (?qCompress@@YA?AVQByteArray@@PBEHH@Z)
      QtBootstrapd.lib(qbytearray.obj) : error LNK2019: ссылка на неразрешенный внешний символ _z_uncompress в функции "class QByteArray __cdecl qUncompress(unsigned char const *,int)" (?qUncompress@@YA?AVQByteArray@@PBEH@Z)
      ..\..\..\bin\moc.exe : fatal error LNK1120: неразрешенных внешних элементов: 2
      

      So qt doesn't pick up LZMA. Even though, the configure outputs me:

      Additional libraries........-LQ:\tg_build\Libraries\lzma\C\Util\LzmaLib\Debug -lLzmaLib.lib
      
      
      

      How can i tell qt to pick up and link lzma library then?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @SourCreamAndOnion Is the lib built using exact same compiler?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SourCreamAndOnion
        wrote on last edited by
        #3

        Well, i have built lzma using this same compiler, according to instructions prior to qt.

        git clone https://github.com/telegramdesktop/lzma.git
        cd lzma\C\Util\LzmaLib
        msbuild LzmaLib.sln /property:Configuration=Debug
        msbuild LzmaLib.sln /property:Configuration=Release
        cd ..\..\..\..
        

        This produce lzma lib compiled by msvc2017.

        But if you look at their build manual, it is suggested to clone this first:

        git clone https://github.com/Microsoft/Range-V3-VS2015 range-v3
        

        And in a qt installation, suggets this commands (its all done from a visual studio 2017 x86 native command prompt ):

        git clone git://code.qt.io/qt/qt5.git qt5_6_2
        cd qt5_6_2
        perl init-repository --module-subset=qtbase,qtimageformats
        git checkout v5.6.2
        cd qtimageformats
        git checkout v5.6.2
        cd ..\qtbase
        git checkout v5.6.2
        git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff
        cd ..

        configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%..\openssl\Release\include" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%..\openssl\Debug\lib\ssleay32.lib %cd%..\openssl\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%..\openssl\Release\lib\ssleay32.lib %cd%..\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015

        jom -j4
        jom -j4 install
        cd ..

        So even though the compiler is msvc2017, they instruct to configure qt with win32-msvc2015. But i assume msvc2017/2015 have the same runtime version, plus i do not have any runtime incompability errors during compile time

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved