Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Generated pkg-config file is broken.
Forum Updated to NodeBB v4.3 + New Features

Generated pkg-config file is broken.

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 275 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.
  • P Offline
    P Offline
    PaulOu
    wrote on last edited by
    #1

    I have a project in which I am building Qt 5.12.2 libraries from source using mingw-w64 to cross compile from linux (in an ubuntu docker container) to Windows binary. They appear to build just fine using this configure script:

    MINGW_INC=${MINGW_PATH}/include
    MINGW_LIB=${MINGW_PATH}/lib
    ./configure \
        -xplatform win32-g++-posix \
        -device-option "CROSS_COMPILE=x86_64-w64-mingw32-" \
        -sysroot "${INSTALL_PREFIX}" \
        -prefix / \
        -I"${MINGW_INC}" \
        -L"${MINGW_LIB}" \
        -opensource \
        -confirm-license \
        -system-proxies \
        -opengl desktop \
        -openssl-runtime \
        -release \
        -nomake examples \
        -nomake tests \
        -skip qtwinextras
    
    # Build qt libraries
    make -j${THREADS}
    
    # Install libraries
    make install
    

    INSTALL_PREFIX is /opt/mingw/Qt/5.12.2. MINGW_PATH is /opt/mingw

    The problem occurs when I go to use these libraries in a QtCreator project, which is properly configured for pkg-config. When the make goes to link a component of the project, it complains that it can't find a half dozen of the Qt libraries. The libraries, as reported by the linker, and supposedly reported to the linker by pkg-config, all end in 'd' - like -lQt5Cored or -lQt5Widgetsd. Of course the 'd' shouldn't be there, but why is that?

    I traced the problem back to the Qt libraries I had compiled, and the .pc files for these libraries all have their respective library ending in 'd.'

    dockeruser@9237d7db98eb:~$ grep -E "\-lQt5.*d" /opt/mingw/Qt/5.12.2/lib/pkgconfig/*.pc
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DAnimation.pc:Libs: -L${libdir} -lQt53DAnimationd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DCore.pc:Libs: -L${libdir} -lQt53DCored 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DExtras.pc:Libs: -L${libdir} -lQt53DExtrasd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DInput.pc:Libs: -L${libdir} -lQt53DInputd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DLogic.pc:Libs: -L${libdir} -lQt53DLogicd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DQuickAnimation.pc:Libs: -L${libdir} -lQt53DQuickAnimationd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DQuickExtras.pc:Libs: -L${libdir} -lQt53DQuickExtrasd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DQuickInput.pc:Libs: -L${libdir} -lQt53DQuickInputd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DQuick.pc:Libs: -L${libdir} -lQt53DQuickd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DQuickRender.pc:Libs: -L${libdir} -lQt53DQuickRenderd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DQuickScene2D.pc:Libs: -L${libdir} -lQt53DQuickScene2Dd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt53DRender.pc:Libs: -L${libdir} -lQt53DRenderd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5AxBase.pc:Libs: -L${libdir} -lQt5AxBased 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5AxContainer.pc:Libs: -L${libdir} -lQt5AxContainerd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5AxServer.pc:Libs: -L${libdir} -lQt5AxServerd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Bluetooth.pc:Libs: -L${libdir} -lQt5Bluetoothd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Charts.pc:Libs: -L${libdir} -lQt5Chartsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Concurrent.pc:Libs: -L${libdir} -lQt5Concurrentd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Core.pc:Libs: -L${libdir} -lQt5Cored 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5DataVisualization.pc:Libs: -L${libdir} -lQt5DataVisualizationd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5DBus.pc:Libs: -L${libdir} -lQt5DBusd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Gamepad.pc:Libs: -L${libdir} -lQt5Gamepadd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Gui.pc:Libs: -L${libdir} -lQt5Guid 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Help.pc:Libs: -L${libdir} -lQt5Helpd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Location.pc:Libs: -L${libdir} -lQt5Locationd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Multimedia.pc:Libs: -L${libdir} -lQt5Multimediad 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5MultimediaWidgets.pc:Libs: -L${libdir} -lQt5MultimediaWidgetsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5NetworkAuth.pc:Libs: -L${libdir} -lQt5NetworkAuthd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Network.pc:Libs: -L${libdir} -lQt5Networkd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Nfc.pc:Libs: -L${libdir} -lQt5Nfcd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5OpenGLExtensions.pc:Libs: -L${libdir} -lQt5OpenGLExtensionsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5OpenGL.pc:Libs: -L${libdir} -lQt5OpenGLd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Positioning.pc:Libs: -L${libdir} -lQt5Positioningd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5PositioningQuick.pc:Libs: -L${libdir} -lQt5PositioningQuickd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5PrintSupport.pc:Libs: -L${libdir} -lQt5PrintSupportd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Purchasing.pc:Libs: -L${libdir} -lQt5Purchasingd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Qml.pc:Libs: -L${libdir} -lQt5Qmld 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5QuickControls2.pc:Libs: -L${libdir} -lQt5QuickControls2d 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Quick.pc:Libs: -L${libdir} -lQt5Quickd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5QuickTest.pc:Libs: -L${libdir} -lQt5QuickTestd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5QuickWidgets.pc:Libs: -L${libdir} -lQt5QuickWidgetsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5RemoteObjects.pc:Libs: -L${libdir} -lQt5RemoteObjectsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Script.pc:Libs: -L${libdir} -lQt5Scriptd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5ScriptTools.pc:Libs: -L${libdir} -lQt5ScriptToolsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Scxml.pc:Libs: -L${libdir} -lQt5Scxmld 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Sensors.pc:Libs: -L${libdir} -lQt5Sensorsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5SerialBus.pc:Libs: -L${libdir} -lQt5SerialBusd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5SerialPort.pc:Libs: -L${libdir} -lQt5SerialPortd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Sql.pc:Libs: -L${libdir} -lQt5Sqld 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Svg.pc:Libs: -L${libdir} -lQt5Svgd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Test.pc:Libs: -L${libdir} -lQt5Testd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5TextToSpeech.pc:Libs: -L${libdir} -lQt5TextToSpeechd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5UiTools.pc:Libs: -L${libdir} -lQt5UiToolsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5VirtualKeyboard.pc:Libs: -L${libdir} -lQt5VirtualKeyboardd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5WebChannel.pc:Libs: -L${libdir} -lQt5WebChanneld 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5WebSockets.pc:Libs: -L${libdir} -lQt5WebSocketsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5WebView.pc:Libs: -L${libdir} -lQt5WebViewd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Widgets.pc:Libs: -L${libdir} -lQt5Widgetsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5XmlPatterns.pc:Libs: -L${libdir} -lQt5XmlPatternsd 
    /opt/mingw/Qt/5.12.2/lib/pkgconfig/Qt5Xml.pc:Libs: -L${libdir} -lQt5Xmld 
    
    

    So, it appears that all the libs are experiencing this problem.

    I have tried all the PKG_CONFIG tricks I know: PKG_CONFIG_PATH, PKG_CONFIG_LIBDIR, and PKG_CONFIG_SYSROOT_DIR. I have tried setting the -pkg-config option. Nothing seems to have any effect on the build.

    Any clues would be greatly appreciated.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      The Qt5Cored.dll and friends are the debug versions of the dynamic link libraries. If your project is being built in debug mode then these are the libraries it should dynamically link to. The /opt/mingw/Qt/5.12.2/bin/qmake in your MingW environment should be arranging the correct version of the link libraries. I believe this is independent of pkg-config.

      On Linux the pkg-config files refer to the release versions. I do not have access to a native MingW install to see what these files contain in that environment, but I would have expected either the release libraries or two sets of pkg-config files.

      P 1 Reply Last reply
      0
      • C ChrisW67

        The Qt5Cored.dll and friends are the debug versions of the dynamic link libraries. If your project is being built in debug mode then these are the libraries it should dynamically link to. The /opt/mingw/Qt/5.12.2/bin/qmake in your MingW environment should be arranging the correct version of the link libraries. I believe this is independent of pkg-config.

        On Linux the pkg-config files refer to the release versions. I do not have access to a native MingW install to see what these files contain in that environment, but I would have expected either the release libraries or two sets of pkg-config files.

        P Offline
        P Offline
        PaulOu
        wrote on last edited by
        #3

        @ChrisW67 - Thanks for the reply and information. It's greatly appreciated.

        As you can see from my configure command above, I have set the build type to release. None of the .dll files in bin and .a files in lib have a trailing 'd'. The only one that sorta makes sense is libQt5QmlDebug.a, but I suspect that's for QML debug, not debugger debug.

        I'll try building both release and debug versions and see where that gets me.

        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