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. Need help seeing my include
Qt 6.11 is out! See what's new in the release blog

Need help seeing my include

Scheduled Pinned Locked Moved Unsolved General and Desktop
21 Posts 3 Posters 6.2k Views 2 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 Anonymous_Banned275

    I am not sure about the code copy.
    Anyway - I need to compare the library compile output, but I will not copy it here unless asked for.

    kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by kshegunov
    #10

    Looking at the defines, I'm pretty sure you forgot to add the module to list in the .pro file (the QT variable).

    Read and abide by the Qt Code of Conduct

    A 1 Reply Last reply
    1
    • kshegunovK kshegunov

      Looking at the defines, I'm pretty sure you forgot to add the module to list in the .pro file (the QT variable).

      A Offline
      A Offline
      Anonymous_Banned275
      wrote on last edited by
      #11

      @kshegunov said in Need help seeing my include:

      Looking at the defines, I'm pretty sure you forgot to add the module to list in the .pro file (the QT variable).

      You found the problem you are the man...
      It complies and tun !

      AS a poor excuse - I did not think the client using the library needs the module.
      Lesson learn.
      THANKS

      1 Reply Last reply
      2
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #12

        @AnneRanch OK, I have one more request for help.
        My project builds, I have added the library to one of the projects.
        I have the library linked in .pro file.

        unix:!macx: LIBS += -L$$OUT_PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source/ -lbtscanner

        INCLUDEPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source
        DEPENDPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source

        unix:!macx: LIBS += -L$$OUT_PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source/ -lbtscanner

        INCLUDEPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source
        DEPENDPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source
        .

        unix:!macx: LIBS += -L$$OUT_PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source/ -lbtscanner

        INCLUDEPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source
        DEPENDPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source

        I still cannot use the library.

        The editor does not recognize
        "btscanner"
        I am still missing something and running out of ideas.

        kshegunovK 1 Reply Last reply
        0
        • A Anonymous_Banned275

          @AnneRanch OK, I have one more request for help.
          My project builds, I have added the library to one of the projects.
          I have the library linked in .pro file.

          unix:!macx: LIBS += -L$$OUT_PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source/ -lbtscanner

          INCLUDEPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source
          DEPENDPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source

          unix:!macx: LIBS += -L$$OUT_PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source/ -lbtscanner

          INCLUDEPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source
          DEPENDPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source
          .

          unix:!macx: LIBS += -L$$OUT_PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source/ -lbtscanner

          INCLUDEPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source
          DEPENDPATH += $$PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source

          I still cannot use the library.

          The editor does not recognize
          "btscanner"
          I am still missing something and running out of ideas.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #13

          What's the exact errors?

          Check the names and the paths, there should be libbtscanner.so inside $$OUT_PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source or it won't build (drop the trailing / too).

          If this library is a static one, you may want to force it within the PRE_TARGETDEPS[1].

          [1] https://doc.qt.io/qt-5/qmake-variable-reference.html#pre-targetdeps

          Read and abide by the Qt Code of Conduct

          A 1 Reply Last reply
          1
          • kshegunovK kshegunov

            What's the exact errors?

            Check the names and the paths, there should be libbtscanner.so inside $$OUT_PWD/../../../../../QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source or it won't build (drop the trailing / too).

            If this library is a static one, you may want to force it within the PRE_TARGETDEPS[1].

            [1] https://doc.qt.io/qt-5/qmake-variable-reference.html#pre-targetdeps

            A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by Anonymous_Banned275
            #14

            @kshegunov Here is a screen shot of the error , ignore the extra ")" error.
            I'll check the path...
            but I can see the build in compiler output ...
            Should I post it ?

            b63d89fa-cb49-4e14-b541-7eadc7e5726e-image.png

            I decided to post part of the compiler output.
            Could you give me an idea where in the output is the resulting library path?

            -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/qe/Qt_5/6.2.0/gcc_64QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I. -I. -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -o moc_device.o moc_device.cpp
            g++ -c -pipe -g -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DBTSCANNER_PROJECT_LIBRARY -DQT_QML_DEBUG -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/qe/Qt_5/6.2.0/gcc_64QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I. -I. -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -o moc_service.o moc_service.cpp
            rm -f libbtscanner.so.1.0.0 libbtscanner.so libbtscanner.so.1 libbtscanner.so.1.0
            g++ -Wl,-rpath,/home/qe/Qt_5/6.2.0/gcc_64/lib -shared -Wl,-soname,libbtscanner.so.1 -o libbtscanner.so.1.0.0 main.o device.o service.o moc_device.o moc_service.o /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Bluetooth.so -pthread /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Network.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6DBus.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Widgets.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Gui.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Core.so -lpthread -lGL
            ln -s libbtscanner.so.1.0.0 libbtscanner.so
            ln -s libbtscanner.so.1.0.0 libbtscanner.so.1
            ln -s libbtscanner.so.1.0.0 libbtscanner.so.1.0
            09:37:11: The process "/usr/bin/make" exited normally.
            09:37:11: Elapsed time: 00:22.

            Here is how library project looks when built from scratch by Qt
            Notice removal of gui and the
            Default rules for deployment.

            I did add DEFINES but not sure what the does.

            I do not have either in my project I build from "normal" project by adding
            TEMPLATE = lib

            PS Looks as "tick tack toe" make a mess when copying . I am sure there is a hack to fix that.

            QT -= gui
            
            TEMPLATE = lib
            DEFINES += TEST_LIBRARY_LIBRARY
            
            CONFIG += c++11
            
            # You can make your code fail to compile if it uses deprecated APIs.
            # In order to do so, uncomment the following line.
            #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
            
            SOURCES += \
                test_library.cpp
            
            HEADERS += \
                TEST_LIBRARY_global.h \
                test_library.h
            
            # Default rules for deployment.
            unix {
                target.path = /usr/lib
            }
            !isEmpty(target.path): INSTALLS += target
            
            
            kshegunovK 1 Reply Last reply
            0
            • A Anonymous_Banned275

              @kshegunov Here is a screen shot of the error , ignore the extra ")" error.
              I'll check the path...
              but I can see the build in compiler output ...
              Should I post it ?

              b63d89fa-cb49-4e14-b541-7eadc7e5726e-image.png

              I decided to post part of the compiler output.
              Could you give me an idea where in the output is the resulting library path?

              -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/qe/Qt_5/6.2.0/gcc_64QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I. -I. -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -o moc_device.o moc_device.cpp
              g++ -c -pipe -g -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DBTSCANNER_PROJECT_LIBRARY -DQT_QML_DEBUG -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/qe/Qt_5/6.2.0/gcc_64QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I. -I. -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -o moc_service.o moc_service.cpp
              rm -f libbtscanner.so.1.0.0 libbtscanner.so libbtscanner.so.1 libbtscanner.so.1.0
              g++ -Wl,-rpath,/home/qe/Qt_5/6.2.0/gcc_64/lib -shared -Wl,-soname,libbtscanner.so.1 -o libbtscanner.so.1.0.0 main.o device.o service.o moc_device.o moc_service.o /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Bluetooth.so -pthread /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Network.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6DBus.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Widgets.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Gui.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Core.so -lpthread -lGL
              ln -s libbtscanner.so.1.0.0 libbtscanner.so
              ln -s libbtscanner.so.1.0.0 libbtscanner.so.1
              ln -s libbtscanner.so.1.0.0 libbtscanner.so.1.0
              09:37:11: The process "/usr/bin/make" exited normally.
              09:37:11: Elapsed time: 00:22.

              Here is how library project looks when built from scratch by Qt
              Notice removal of gui and the
              Default rules for deployment.

              I did add DEFINES but not sure what the does.

              I do not have either in my project I build from "normal" project by adding
              TEMPLATE = lib

              PS Looks as "tick tack toe" make a mess when copying . I am sure there is a hack to fix that.

              QT -= gui
              
              TEMPLATE = lib
              DEFINES += TEST_LIBRARY_LIBRARY
              
              CONFIG += c++11
              
              # You can make your code fail to compile if it uses deprecated APIs.
              # In order to do so, uncomment the following line.
              #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
              
              SOURCES += \
                  test_library.cpp
              
              HEADERS += \
                  TEST_LIBRARY_global.h \
                  test_library.h
              
              # Default rules for deployment.
              unix {
                  target.path = /usr/lib
              }
              !isEmpty(target.path): INSTALLS += target
              
              
              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by kshegunov
              #15

              @AnneRanch said in Need help seeing my include:

              but I can see the build in compiler output ...

              The compiler complains that it doesn't know what the btscanner identifier means. It is missing a declaration or a definition, which usually means that the includes are wrong (somehow). Is this a function?

              g++ -Wl,-rpath,/home/qe/Qt_5/6.2.0/gcc_64/lib -shared -Wl,-soname,libbtscanner.so.1 -o libbtscanner.so.1.0.0 main.o device.o service.o moc_device.o moc_service.o /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Bluetooth.so -pthread /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Network.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6DBus.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Widgets.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Gui.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Core.so -lpthread -lGL

              That's the linker call, so the library is in /home/qe/Qt_5/6.2.0/gcc_64/lib, assuming that the rpath's set to the build directory.

              I did add DEFINES but not sure what the does.

              I don't follow. What defines and why?

              PS Looks as "tick tack toe" make a mess when copying . I am sure there is a hack to fix that.
              [snip]

              If that's the project file that's supposed to use the btscanner library, then it is missing the proper INCLUDEPATH and the LIBS variables being filled in. It doesn't matter if that's an application or library (template) it still needs to link against the dependency to be able to use it.

              Should look something like this:

              HEADERS += \
                  TEST_LIBRARY_global.h \
                  test_library.h
              
              INCLUDEPATH += /home/qe/<...>/include<...>                   # Wherever the headers reside
              LIBS += -L/home/qe/Qt_5/6.2.0/gcc_64/lib -lbtscanner
              

              Read and abide by the Qt Code of Conduct

              A 1 Reply Last reply
              2
              • A Offline
                A Offline
                Anonymous_Banned275
                wrote on last edited by
                #16

                I am making some progress

                Here is part of the compiler / linker .
                It looks as linker is creating .a (shared ?) library.

                I have added -Wl --verbose , much needed tool to track what is happening ,and do not the see "btscanner.so" library build at all.

                I am going to see how adding the HEADER and INCLUDE to .pro file make a difference.

                IT SHOULD - I have been missing that from get go !!!

                /home/qe/Qt_5/6.2.0/gcc_64/libexec/moc -DBTSCANNER_PROJECT_LIBRARY -DQT_QML_DEBUG -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include /media/qe/TSET_QT_LABEL/QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source/moc_predefs.h -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -I/media/qe/TSET_QT_LABEL/QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I/usr/include/c++/10 -I/usr/include/x86_64-linux-gnu/c++/10 -I/usr/include/c++/10/backward -I/usr/lib/gcc/x86_64-linux-gnu/10/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include service.h -o moc_service.cpp
                g++ -c -pipe -g -fPIC -std=gnu++1z -Wall -Wextra -D_REENTRANT -DBTSCANNER_PROJECT_LIBRARY -DQT_QML_DEBUG -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I. -I. -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -o moc_device.o moc_device.cpp
                g++ -c -pipe -g -fPIC -std=gnu++1z -Wall -Wextra -D_REENTRANT -DBTSCANNER_PROJECT_LIBRARY -DQT_QML_DEBUG -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I. -I. -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -o moc_service.o moc_service.cpp
                rm -f libbtscanner.a
                ar cqs libbtscanner.a main.o device.o service.o moc_device.o moc_service.o

                kshegunovK 1 Reply Last reply
                0
                • kshegunovK kshegunov

                  @AnneRanch said in Need help seeing my include:

                  but I can see the build in compiler output ...

                  The compiler complains that it doesn't know what the btscanner identifier means. It is missing a declaration or a definition, which usually means that the includes are wrong (somehow). Is this a function?

                  g++ -Wl,-rpath,/home/qe/Qt_5/6.2.0/gcc_64/lib -shared -Wl,-soname,libbtscanner.so.1 -o libbtscanner.so.1.0.0 main.o device.o service.o moc_device.o moc_service.o /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Bluetooth.so -pthread /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Network.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6DBus.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Widgets.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Gui.so /home/qe/Qt_5/6.2.0/gcc_64/lib/libQt6Core.so -lpthread -lGL

                  That's the linker call, so the library is in /home/qe/Qt_5/6.2.0/gcc_64/lib, assuming that the rpath's set to the build directory.

                  I did add DEFINES but not sure what the does.

                  I don't follow. What defines and why?

                  PS Looks as "tick tack toe" make a mess when copying . I am sure there is a hack to fix that.
                  [snip]

                  If that's the project file that's supposed to use the btscanner library, then it is missing the proper INCLUDEPATH and the LIBS variables being filled in. It doesn't matter if that's an application or library (template) it still needs to link against the dependency to be able to use it.

                  Should look something like this:

                  HEADERS += \
                      TEST_LIBRARY_global.h \
                      test_library.h
                  
                  INCLUDEPATH += /home/qe/<...>/include<...>                   # Wherever the headers reside
                  LIBS += -L/home/qe/Qt_5/6.2.0/gcc_64/lib -lbtscanner
                  
                  A Offline
                  A Offline
                  Anonymous_Banned275
                  wrote on last edited by Anonymous_Banned275
                  #17

                  @kshegunov This is a very good point .

                  "normal " code has
                  header
                  source file

                  relations.

                  now SUDDIRS adds .pro

                  and default project mimic the

                  header
                  source file

                  relation in .pro file

                  without changing anything - not sure about that - done that few versions ago

                  I can "include"
                  a library header file in my .cpp file - the client reference point to library ( my inherited definition ) - editor(!) will complain if an attempt to include inaccessible file is made (nice real time feature kidos ) ,
                  intelisense will display ONLY accessible files .

                  What is suggested that IN ADDITION to C++ relations between client and library

                  there need to be manually added "stuff " to .pro file where access to libray is desired.

                  I would expect this to be done by SUBDIR option "add library" .
                  Easy to
                  verify.

                  Sounds reasonable.

                  HOWEVER, I now have another issue
                  if I add
                  CONFIG += staticlib - as recommended in other forum

                  I get bscanner.a = not btscanner.so

                  So I got two issues right now.
                  This will take some time to fix stand by...

                  1 Reply Last reply
                  0
                  • A Anonymous_Banned275

                    I am making some progress

                    Here is part of the compiler / linker .
                    It looks as linker is creating .a (shared ?) library.

                    I have added -Wl --verbose , much needed tool to track what is happening ,and do not the see "btscanner.so" library build at all.

                    I am going to see how adding the HEADER and INCLUDE to .pro file make a difference.

                    IT SHOULD - I have been missing that from get go !!!

                    /home/qe/Qt_5/6.2.0/gcc_64/libexec/moc -DBTSCANNER_PROJECT_LIBRARY -DQT_QML_DEBUG -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include /media/qe/TSET_QT_LABEL/QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source/moc_predefs.h -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -I/media/qe/TSET_QT_LABEL/QT_6/QT6_PRO/CAT/SUB_PRO/EXAMPLES_COPY/QT_5/Examples/Qt-6.2.0/bluetooth/btscanner_source -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I/usr/include/c++/10 -I/usr/include/x86_64-linux-gnu/c++/10 -I/usr/include/c++/10/backward -I/usr/lib/gcc/x86_64-linux-gnu/10/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include service.h -o moc_service.cpp
                    g++ -c -pipe -g -fPIC -std=gnu++1z -Wall -Wextra -D_REENTRANT -DBTSCANNER_PROJECT_LIBRARY -DQT_QML_DEBUG -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I. -I. -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -o moc_device.o moc_device.cpp
                    g++ -c -pipe -g -fPIC -std=gnu++1z -Wall -Wextra -D_REENTRANT -DBTSCANNER_PROJECT_LIBRARY -DQT_QML_DEBUG -DQT_BLUETOOTH_LIB -DQT_NETWORK_LIB -DQT_DBUS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/qe/Qt_5/6.2.0/gcc_64/include -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtBluetooth -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtNetwork -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtDBus -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtWidgets -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtGui -I/home/qe/Qt_5/6.2.0/gcc_64/include/QtCore -I. -I. -I/home/qe/Qt_5/6.2.0/gcc_64/mkspecs/linux-g++ -o moc_service.o moc_service.cpp
                    rm -f libbtscanner.a
                    ar cqs libbtscanner.a main.o device.o service.o moc_device.o moc_service.o

                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by kshegunov
                    #18

                    @AnneRanch said in Need help seeing my include:

                    It looks as linker is creating .a (shared ?) library.

                    That's an archive, a.k.a. a static library.

                    now SUDDIRS adds .pro

                    SUBDIRS is simply a tree-like build for qmake. It doesn't have to do with code at all. Each project is built separately and all considerations for stand-alone projects apply. The INCLUDEPATH is necessary for the compiler so it has the declarations avaialble, without it names (i.e. identifiers) mean nothing to it. LIBS is necessary for the linker, whenever it starts to resolve the objects it needs to know what symbol is defined in which binary (library, object file, executable).

                    HOWEVER, I now have another issue
                    if I add
                    CONFIG += staticlib - as recommended in other forum

                    Don't do that. Stick to dynamic libraries, it's simpler. Otherwise you need to satisfy the dependencies on the client side for the linking.
                    Also on linux it's necessary as far as I recall to add the archive to the PRE_TARGETDEPS.

                    Read and abide by the Qt Code of Conduct

                    A 1 Reply Last reply
                    2
                    • kshegunovK kshegunov

                      @AnneRanch said in Need help seeing my include:

                      It looks as linker is creating .a (shared ?) library.

                      That's an archive, a.k.a. a static library.

                      now SUDDIRS adds .pro

                      SUBDIRS is simply a tree-like build for qmake. It doesn't have to do with code at all. Each project is built separately and all considerations for stand-alone projects apply. The INCLUDEPATH is necessary for the compiler so it has the declarations avaialble, without it names (i.e. identifiers) mean nothing to it. LIBS is necessary for the linker, whenever it starts to resolve the objects it needs to know what symbol is defined in which binary (library, object file, executable).

                      HOWEVER, I now have another issue
                      if I add
                      CONFIG += staticlib - as recommended in other forum

                      Don't do that. Stick to dynamic libraries, it's simpler. Otherwise you need to satisfy the dependencies on the client side for the linking.
                      Also on linux it's necessary as far as I recall to add the archive to the PRE_TARGETDEPS.

                      A Offline
                      A Offline
                      Anonymous_Banned275
                      wrote on last edited by
                      #19

                      @kshegunov said in Need help seeing my include:

                      @AnneRanch said in Need help seeing my include:

                      It looks as linker is creating .a (shared ?) library.

                      That's an archive, a.k.a. a static library.

                      now SUDDIRS adds .pro

                      SUBDIRS is simply a tree-like build for qmake. It doesn't have to do with code at all. Each project is built separately and all considerations for stand-alone projects apply. The INCLUDEPATH is necessary for the compiler so it has the declarations avaialble, without it names (i.e. identifiers) mean nothing to it. LIBS is necessary for the linker, whenever it starts to resolve the objects it needs to know what symbol is defined in which binary (library, object file, executable).

                      HOWEVER, I now have another issue
                      if I add
                      CONFIG += staticlib - as recommended in other forum

                      Don't do that. Stick to dynamic libraries, it's simpler. Otherwise you need to satisfy the dependencies on the client side for the linking.
                      Also on linux it's necessary as far as I recall to add the archive to the PRE_TARGETDEPS.

                      Thanks for sticking with this mess.

                      I decided to actually check if the .so library is built and where.
                      Now I need to verify if that is for real as far as SUDIRS go.

                      I really believe , I am convinced, I have created this myself by adding
                      TEMPLATE = lib to the project.

                      I have no issue using / accessing the real library , created by Qt SUDBIRS .

                      There are copies of libbtscanner .so files :

                      qe@qe-desktop:~$ find ./ -name "*btscanner.so"
                      ./Qt_5/Examples/Qt-6.2.0/bluetooth/btscanner/libbtscanner.so
                      ./Qt/Examples/Qt-5.15.2/bluetooth/build-btscanner-Desktop-Debug/libbtscanner.so
                      qe@qe-desktop:~$

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        Anonymous_Banned275
                        wrote on last edited by
                        #20

                        I have rebuild my SUDIRS project .
                        I have a main (widget) application and first subproject - widget application converted to library and another subproject - a real library crreated by Qt.

                        No problem using the real library.
                        Same problem using the converted library.

                        Now the error is what has been suspect from get go

                        bb4ab957-cb8c-463e-a1f1-8c48629d3818-image.png

                        So a same error / story but now official.
                        Hope I find the missing link soon...

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          Anonymous_Banned275
                          wrote on last edited by
                          #21

                          I have given up.

                          Trying to add plain project and converting it to library is futile.
                          I now have main SUBDIR project with "added library".
                          The library is build as SUBDIR internal library and added as such to main SUDBIR project. Works as expected.
                          I'll we transferring "btscanner" code example piece by piece to my library, hopefully learning more about Bluetooth in the process.

                          I would like to express my appreciation to all who helped , albeit unsuccessfully , to fix this problem.

                          CASE closed

                          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