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. Building qt5 as a dependency via vcpkg wrong g++ compiler flag
Forum Updated to NodeBB v4.3 + New Features

Building qt5 as a dependency via vcpkg wrong g++ compiler flag

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
1 Posts 1 Posters 688 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    AndreD
    wrote on last edited by
    #1

    ERROR: Feature 'system-assimp' was enabled, but the pre-condition 'features.assimp && libs.assimp' failed
    The Error reported by qmake while trying to build qt5-3D

    So as an ultimate goal I want to build and install COLMAP via vcpkg as recommended by the developers of colmap.

    In the process of doing so, the installation of qt-3D gets invoked via vcpkg as it is a necessary dependency.

    vcpkg handles installing (sorry if that's the wrong terminology) the dependencies for qt-3D perfectly fine and hands them over as parameters (path to installation of libraries) to qmake, which is the build system used to build qt-3D (so far my understanding). vcpkg decides to use system installed version of assimp instead of the bundled library and therefore sets the appropriate flag where to search for the system installation of assimp correctly.

    As of my understanding the handling over or setting of parameters for qmake is done in line 50/54 in the prortfile.cmake of qt-3d which can be accessed via path/to/vcpkg/ports/qt-3d/portfile.cmake .

    But step by step:

    • $PWD = /path/to/vcpkg here /home/dueding/vcpkg
    • call ./vcpkg install comap[cuda] (I set the VCPKG_DEFAULT_TRIPLET via the environment to x64-linux)
    • error gets thrown: error: building qt5-3d:x64-linux failed with: BUILD_FAILED
    • error gets tracked to call to:
    /home/dueding/vcpkg/installed/x64-linux/tools/qt5/bin/qmake \ 
    CONFIG-=debug CONFIG+=release QMAKE_CC=cc QMAKE_CXX=c++ \ 
    QMAKE_AR=ar QMAKE_RANLIB=ranlib QMAKE_STRIP=strip \ 
    QMAKE_NM=nm QMAKE_RC= QMAKE_MT= QMAKE_AR+=qc \ 
    QMAKE_LINK=c++ QMAKE_LINK_SHLIB=c++ QMAKE_LINK_C=cc \ 
    QMAKE_LINK_C_SHLIB=cc "QMAKE_CFLAGS_RELEASE+=-fPIC \ 
    -O3 -DNDEBUG" "QMAKE_CXXFLAGS_RELEASE+=-fPIC -O3 \ 
    -DNDEBUG" CONFIG-=shared CONFIG*=static \ 
    /home/dueding/vcpkg/buildtrees/qt5-3d/src/5.15.9-1ddf60049e.clean \ 
    -qtconf /home/dueding/vcpkg/buildtrees/qt5-3d/x64-linux-rel/qt.conf \ 
    -- -system-assimp "ASSIMP_LIBS=/home/dueding/vcpkg/installed/x64-linux/lib/libassimp.a \ 
    /home/dueding/vcpkg/installed/x64-linux/lib/libpugixml.a \ 
    /home/dueding/vcpkg/installed/x64-linux/lib/libpoly2tri.a \ 
    /home/dueding/vcpkg/installed/x64-linux/lib/libjpeg.a \ 
    /home/dueding/vcpkg/installed/x64-linux/lib/libpng16.a \ 
    /home/dueding/vcpkg/installed/x64-linux/lib/libkubazip.a \ 
    /home/dueding/vcpkg/installed/x64-linux/lib/libminizip.a \ 
    /home/dueding/vcpkg/installed/x64-linux/lib/libbz2.a \ 
    /home/dueding/vcpkg/installed/x64-linux/lib/libz.a -lGL -lXxf86vm -lX11"
    
    • 3 logs are provided:
    See logs for more information:
          /home/dueding/vcpkg/buildtrees/qt5-3d/config-x64-linux-rel-config.log
          /home/dueding/vcpkg/buildtrees/qt5-3d/config-x64-linux-rel-out.log
          /home/dueding/vcpkg/buildtrees/qt5-3d/config-x64-linux-rel-err.log
    
    • important content of error log:
    Configure summary:
    
    Qt 3D:
      Assimp ................................. yes
      System Assimp .......................... no
      Output Qt3D GL traces .................. no
      Use SSE2 instructions .................. yes
      Use AVX2 instructions .................. no
      Aspects:
        Render aspect ........................ yes
        Input aspect ......................... yes
        Logic aspect ......................... yes
        Animation aspect ..................... yes
        Extras aspect ........................ yes
    Qt 3D Renderers:
      OpenGL Renderer ........................ yes
      RHI Renderer ........................... no
    Qt 3D GeometryLoaders:
      Autodesk FBX ........................... no
    
    ERROR: Feature 'system-assimp' was enabled, but the pre-condition 'features.assimp && libs.assimp' failed.
    
    • important contents of config log
    > g++ -Wl,-O1 -o assimp main.o   -L/home/dueding/vcpkg/installed/x64-linux/lib -L/home/dueding/vcpkg/installed/x64-linux/lib/manual-link -L/home/dueding/vcpkg/installed/x64-linux/lib/pkgconfig/../../lib -llibassimp -lstdc++
    > /usr/bin/ld: cannot find -llibassimp: No such file or directory
    > /usr/bin/ld: note to link with /home/dueding/vcpkg/installed/x64-linux/lib/libassimp.a use -l:libassimp.a or rename i>
    

    As you can see the compiler flag -l (lowercase L) is set with -llibassimp what tries to compile against a library named liblibassimp.a. But obviously the file is named libassimp.a. The file cannot be renamed because others depend on it. So is this g++ call done by qmake and how can I alternate the compiler flags? I fail to find the file that sets them.
    Maybe there is an easy way to change compilers to avoid trouble shooting, but I am worried that might just bring new problems.

    Best,

    Andre

    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