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

configure with -system-libjpeg fails



  • Hi
    I am trying to configure and build qt with -system-libjpeg(libjpeg-turbo) on windows 10. One of my failing configure cmds is:

    C:\Qt\5.14.1\build_jpgturbo_msvc2017_64>..\Src\configure.bat -prefix ..\install_jpgturbo_msvc2017_64 -v -release -shared -platform win32-msvc -opensource -confirm-license -system-libjpeg -nomake tests -I "C:\_DEV_LIBS\C++\libjpeg-turbo\libjpeg-turbo64\include" -L "C:\_DEV_LIBS\C++\libjpeg-turbo\libjpeg-turbo64\lib"
    

    The configure process ends with error:

    Image formats:
        GIF .................................. yes
        ICO .................................. yes
        JPEG ................................. yes
          Using system libjpeg ............... no
        PNG .................................. yes
          Using system libpng ................ no
    
    ERROR: Feature 'system-jpeg' was enabled, but the pre-condition 'features.jpeg && libs.libjpeg' failed.
    

    I have the latest vcpkg version, pearl and python installed. What else can I do to fix this error?

    Thanks in advance


  • Lifetime Qt Champion

    @solarisx You should check the configure.log file - it should provide more information about what exactly is the problem.



  • Thanks. Seems the libjpeg_turbo header and lib files are not found. I have the paths in the configure cmd. Did I specified them wrong?
    C:\_DEV_LIBS\C++\libjpeg-turbo\libjpeg-turbo64\include\jpeglib.h exist!

    configure.log:

    Command line: -prefix ..\install_jpgturbo_msvc2017_64 -v -release -shared -platform win32-msvc -opensource -confirm-license -system-libjpeg -nomake tests -I C:\_DEV_LIBS\C++\libjpeg-turbo\libjpeg-turbo64\include -L C:\_DEV_LIBS\C++\libjpeg-turbo\libjpeg-turbo64\lib
    ...
    Global lib dirs: [C:\\_DEV_LIBS\\C++\\libjpeg-turbo\\libjpeg-turbo64\\lib] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\lib\\x64" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x64" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x64" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\ucrt\\x64" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\um\\x64"]
    Global inc dirs: [C:\\_DEV_LIBS\\C++\\libjpeg-turbo\\libjpeg-turbo64\\include] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\include" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\include" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\shared" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\winrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\cppwinrt"]
    ...
    loaded result for library config.qtbase_gui.libraries.libjpeg
    Trying source 0 (type pkgConfig) of library libjpeg ...
    pkg-config use disabled globally.
      => source produced no result.
    Trying source 1 (type inline) of library libjpeg ...
    jpeglib.h not found in [] and global paths.
      => source produced no result.
    Trying source 2 (type inline) of library libjpeg ...
    jpeglib.h not found in [] and global paths.
      => source produced no result.
    test config.qtbase_gui.libraries.libjpeg FAILED
    


  • in the configure.log are several fatal errors:

    Notice: re-mapping requested qmake spec to unified 'win32-msvc'.
    ...
    > main.c
    > .\main.c(5): fatal error C1189: #error:  __STDC_VERSION__ must be >= 199901L
    > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"' : return code '0x2'
    ...
    > main.cpp
    > .\main.cpp(4): fatal error C1083: Cannot open include file: 'sys/socket.h': No such file or directory
    > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"' : return code '0x2'
    

    'sys/socket.h' is LINUX. How to specify the the Windows platform?
    I use -platform win32-msvc and run the configure from the Visual Studio 2017 Developer Command Prompt on Windows 10.
    Anything else to do?


  • Lifetime Qt Champion

    @solarisx said in configure with -system-libjpeg fails:

    'sys/socket.h' is LINUX

    I think you can ignore it - just one of many tests.
    More interesting is "fatal error C1189: #error: STDC_VERSION must be >= 199901L" - which test is that?



  • loaded result for config test config.qtbase.tests.c99
    + cd /d C:\Qt\5.14.1\build_jpgturbo_msvc2017_64\config.tests\c99 && C:\Qt\5.14.1\build_jpgturbo_msvc2017_64\qtbase\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" C:/Qt/5.14.1/build_jpgturbo_msvc2017_64/config.tests/c99
    + cd /d C:\Qt\5.14.1\build_jpgturbo_msvc2017_64\config.tests\c99 && set MAKEFLAGS=& nmake
    > Microsoft (R) Program Maintenance Utility Version 14.16.27035.0
    > Copyright (C) Microsoft Corporation.  All rights reserved.
    > 	cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -O2 -MD -W0 -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DNDEBUG -I. -IC:\Qt\5.14.1\Src\qtbase\mkspecs\win32-msvc -Fo @C:\Users\Phili\AppData\Local\Temp\nm2059.tmp
    > main.c
    > .\main.c(5): fatal error C1189: #error:  __STDC_VERSION__ must be >= 199901L
    > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"' : return code '0x2'
    > Stop.
    test config.qtbase.tests.c99 FAILED
    


  • This post is deleted!


  • Ok. Found the problem. Thought using a 64bit command prompt results in a 64bit qt build. Now it works. Using x86 Native Command Prompt for VS 2017 as admin and 32bit libs of jpeg-turbo.

    @jsulm thank you very much for your time.

    Greets solarisx


Log in to reply