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. How to exclude QtZlib folder from ${Qt6Core5Compat_INCLUDE_DIRS}?
QtWS25 Last Chance

How to exclude QtZlib folder from ${Qt6Core5Compat_INCLUDE_DIRS}?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 279 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.
  • G Offline
    G Offline
    Gertio
    wrote on last edited by
    #1

    Hello, I am a contributor for an open source project, which uses Qt. We compile our own zlib and don't use Qtzlib, we need Qt6Core5Compat module though. So we recently made compiling with Qt6 possible, but we still need the Compatmodule, so when in CMake we do this for our project:
    include_directories(${Qt6Core5Compat_INCLUDE_DIRS})
    which results in some folders being included to the Visual Studio solution, these ones:
    C:\Qt\6.4.1\msvc2019_64\include\QtCore5Compat
    and
    C:\Qt\6.4.1\msvc2019_64\include\QtZlib

    Including the QtZlib breaks things for us though, because we have our own zlib.h in our own directory.

    How can I include Qt5Core5Compat dir but not the QtZlib dir?

    Christian EhrlicherC 1 Reply Last reply
    0
    • G Gertio

      Hello, I am a contributor for an open source project, which uses Qt. We compile our own zlib and don't use Qtzlib, we need Qt6Core5Compat module though. So we recently made compiling with Qt6 possible, but we still need the Compatmodule, so when in CMake we do this for our project:
      include_directories(${Qt6Core5Compat_INCLUDE_DIRS})
      which results in some folders being included to the Visual Studio solution, these ones:
      C:\Qt\6.4.1\msvc2019_64\include\QtCore5Compat
      and
      C:\Qt\6.4.1\msvc2019_64\include\QtZlib

      Including the QtZlib breaks things for us though, because we have our own zlib.h in our own directory.

      How can I include Qt5Core5Compat dir but not the QtZlib dir?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Gertio said in How to exclude QtZlib folder from ${Qt6Core5Compat_INCLUDE_DIRS}?:

      How can I include Qt5Core5Compat dir but not the QtZlib dir?

      You can't since it's a dependency.

      Either remove the dependency to Qt5Core5Compat or compile QtZlib with the same zlib version as you use or use the zlib version QtZlib is using.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gertio
        wrote on last edited by
        #3

        But actually, QtZlib is a dependency of Core and not core5compat... It seems suspicious to me..

        Christian EhrlicherC 1 Reply Last reply
        0
        • G Gertio

          But actually, QtZlib is a dependency of Core and not core5compat... It seems suspicious to me..

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Gertio said in How to exclude QtZlib folder from ${Qt6Core5Compat_INCLUDE_DIRS}?:

          But actually, QtZlib is a dependency of Core and not core5compat

          Then the include path is also added when you use QtCore.
          Aynway - you can not add two libraries with the same name to your project - it will break. You must make sure that every part of your app is using the same version of an external library.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          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