Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Building Qt with MSVC 2019



  • I am attempting to build Qt master with VS2019.
    The x64 build failed so am using vcvars32 build.

    configure -platform win32-msvc -developer-build -opensource -nomake examples -nomake tests
    
            link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.12 /OUT:..\..\..\..\plugins\platforms\qdirect2d.dll @C:\Users\aaron\AppData\Local\Temp\qdirect2d.dll.12904.92047.jom
       Creating library ..\..\..\..\plugins\platforms\qdirect2d.lib and object ..\..\..\..\plugins\platforms\qdirect2d.exp
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_create_read_struct referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_longjmp_fn referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_create_info_struct referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_read_info referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_expand_gray_1_2_4_to_8 referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_palette_to_rgb referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_tRNS_to_alpha referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_gray_to_rgb referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_filler referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_packing referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_interlace_handling referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_strip_16 referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_read_update_info referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_read_image referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_read_end referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_destroy_read_struct referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_get_error_ptr referenced in function _error_callback
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_read_fn referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_get_io_ptr referenced in function _read_data_from_FT_Stream
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_read_user_transform_fn referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_error referenced in function _read_data_from_FT_Stream
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_get_valid referenced in function _Load_SBit_Png
    qtfreetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_get_IHDR referenced in function _Load_SBit_Png
    ..\..\..\..\plugins\platforms\qdirect2d.dll : fatal error LNK1120: 23 unresolved externals
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_create_read_struct referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_longjmp_fn referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_create_info_struct referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_read_info referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_expand_gray_1_2_4_to_8 referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_palette_to_rgb referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_tRNS_to_alpha referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_gray_to_rgb referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_filler referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_packing referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_interlace_handling referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_strip_16 referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_read_update_info referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_read_image referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_read_end referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_destroy_read_struct referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_get_error_ptr referenced in function _error_callback
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_read_fn referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_get_io_ptr referenced in function _read_data_from_FT_Stream
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_set_read_user_transform_fn referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_error referenced in function _read_data_from_FT_Stream
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_get_valid referenced in function _Load_SBit_Png
    qtfreetyped.lib(sfnt.obj) : error LNK2019: unresolved external symbol _png_get_IHDR referenced in function _Load_SBit_Png
    ..\..\..\..\plugins\platforms\qdirect2dd.dll : fatal error LNK1120: 23 unresolved externals
    jom: C:\Users\aaron\GitHub\qt5\qtbase\src\plugins\platforms\direct2d\Makefile.Debug [..\..\..\..\plugins\platforms\qdirect2dd.dll] Error 1120
    jom: C:\Users\aaron\GitHub\qt5\qtbase\src\plugins\platforms\direct2d\Makefile [debug-all] Error 2
    jom: C:\Users\aaron\GitHub\qt5\qtbase\src\plugins\platforms\direct2d\Makefile [release-all] Error 2
    jom: C:\Users\aaron\GitHub\qt5\qtbase\src\plugins\platforms\Makefile [sub-direct2d-make_first] Error 2
    jom: C:\Users\aaron\GitHub\qt5\qtbase\src\plugins\Makefile [sub-platforms-make_first] Error 2
    jom: C:\Users\aaron\GitHub\qt5\qtbase\src\Makefile [sub-plugins-make_first] Error 2
    jom: C:\Users\aaron\GitHub\qt5\qtbase\Makefile [sub-src-make_first] Error 2
    jom: C:\Users\aaron\GitHub\qt5\Makefile [module-qtbase-make_first] Error 2
    


  • @AaronNGray said in Building Qt with MSVC 2019:

    png_create_read_struct

    Looks like I am missing libpng !
    Are there any other external libraries I need and how do I install libpng for Qt on Windows ?

    I have tried :-

    ..\qt5\configure -platform win32-msvc -developer-build -opensource -nomake examples -nomake tests -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz
    


  • Hi, jiust tested on my Windows 7 PC, it has MSVC 2019 installed, I downloaded the source for Qt 5.12.9 using MaintenanceTool and tried your first configure command

    configure -platform win32-msvc -developer-build -opensource -nomake examples -nomake tests
    

    I had installed Perl but forgot to install Python so the build stopped when it got to Qt5Qml.dll, but all of the plugins were built, including platforms\qdirect2d.dll and platforms\qdirect2dd.dll.

    Anyway, libpng should be in the source tree already (it was in mine).
    Here's my qt_ext_libpng.pri file that was generated during the build (it's in Src\qtbase\mkspecs\modules):

    QMAKE_DEPENDS_LIBPNG_CC =
    QMAKE_DEPENDS_LIBPNG_LD =
    QMAKE_INCDIR_LIBPNG = C:/Qt/5.12.9/Src/qtbase/src/3rdparty/libpng
    QMAKE_DEFINES_LIBPNG = 
    QMAKE_LIBS_LIBPNG =
    QMAKE_LIBS_LIBPNG_DEBUG = C:/Qt/5.12.9/Src/qtbase/lib/qtlibpngd.lib
    QMAKE_LIBS_LIBPNG_RELEASE = C:/Qt/5.12.9/Src/qtbase/lib/qtlibpng.lib
    

    Do yours look like the same?



  • @hskoglund said in Building Qt with MSVC 2019:

    qt_ext_libpng.pri

    Yes, and the lib's are there.

    Maybe I need to use the MaintenanceTool as I just used git and the install instructions.

    Do you mean this :- https://www.qt.io/download-qt-installer ?



  • Yes, use it to get the 5.12.9 source.


Log in to reply