Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-113787

error: 'IFF_UP' conflicts with a previous declaration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.2, 6.6.0
    • 6.5.1
    • Network
    • None
    • Linux/X11
    • 456cfa0bd (dev), 93b58f8d5 (6.5)

    Description

       

      I've got a symbol conflict  on linux with unity build enabled on conda-forge:

      qnetworkinterface_linux.cpp:6, 2023-05-24T07:40:21.5559128Z from $SRC_DIR/build/qtbase/src/network/CMakeFiles/Network.dir/Unity/unity_1_cxx.cxx:65: 2023-05-24T07:40:21.5560110Z $BUILD_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/include/linux/if.h:71:46: error: 'IFF_UP' conflicts with a previous declaration 2023-05-24T07:40:21.5560463Z 71 | IFF_UP = 1<<0, /* sysfs */ 2023-05-24T07:40:21.5560693Z | ^ 2023-05-24T07:40:21.5560968Z In file included from $SRC_DIR/qtbase/src/network/socket/qnativesocketengine_unix.cpp:21, 2023-05-24T07:40:21.5561299Z from $SRC_DIR/build/qtbase/src/network/CMakeFiles/Network.dir/Unity/unity_1_cxx.cxx:63: 2023-05-24T07:40:21.5561763Z $BUILD_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/include/net/if.h:44:5: note: previous declaration '<unnamed enum> IFF_UP' 2023-05-24T07:40:21.5562074Z 44 | IFF_UP = 0x1, /* Interface is up. */

       

      excluding qnativesocketengine_unix.cpp from unity build makes the erro go away:

       

      diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt 
      index ec6e5f1426..c5636689b0 100644 
      --- a/qtbase/src/network/CMakeLists.txt 
      +++ b/qtbase/src/network/CMakeLists.txt 
      @@ -381,6 +381,8 @@ if (WIN32) 
                                      PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) 
      endif() 
       
      +set_source_files_properties(socket/qnativesocketengine_unix.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) 
      + 
      # include the snippet projects for developer-builds 
      if(QT_FEATURE_private_tests) 
          add_subdirectory(doc/snippets/network)

       

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            manordheim Mårten Nordheim
            jschueller Julien Schueller
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes