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. Can not create/use DLL

Can not create/use DLL

Scheduled Pinned Locked Moved Unsolved General and Desktop
28 Posts 4 Posters 2.7k 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.
  • J JacobNovitsky

    @Paul-Colby hi there :)
    Screenshot from 2023-09-26 14-28-20.png Screenshot from 2023-09-26 14-33-31.png

    SGaist still, I could not find answer to my question :)
    please guide me

    SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #5

    @JacobNovitsky please show the content of the files requested by @Paul-Colby.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    J 1 Reply Last reply
    0
    • SGaistS SGaist

      @JacobNovitsky please show the content of the files requested by @Paul-Colby.

      J Offline
      J Offline
      JacobNovitsky
      wrote on last edited by
      #6

      @SGaist sorry, just woke up :)

      MyLib.pro

      TEMPLATE = lib
      DEFINES += MYLIB_LIBRARY

      CONFIG += c++17

      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 +=
      mylib.cpp

      HEADERS +=
      MyLib_global.h
      mylib.h

      Default rules for deployment.

      unix {
      target.path = /usr/lib
      }
      !isEmpty(target.path): INSTALLS += target

      useDll.pro
      TEMPLATE = app
      CONFIG += console c++17
      CONFIG -= app_bundle
      #CONFIG -= qt

      QT += core

      QT += gui
      #QT += qapplication
      QT += widgets quick

      SOURCES +=
      main.cpp

      Paul ColbyP 1 Reply Last reply
      0
      • J JacobNovitsky

        @SGaist sorry, just woke up :)

        MyLib.pro

        TEMPLATE = lib
        DEFINES += MYLIB_LIBRARY

        CONFIG += c++17

        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 +=
        mylib.cpp

        HEADERS +=
        MyLib_global.h
        mylib.h

        Default rules for deployment.

        unix {
        target.path = /usr/lib
        }
        !isEmpty(target.path): INSTALLS += target

        useDll.pro
        TEMPLATE = app
        CONFIG += console c++17
        CONFIG -= app_bundle
        #CONFIG -= qt

        QT += core

        QT += gui
        #QT += qapplication
        QT += widgets quick

        SOURCES +=
        main.cpp

        Paul ColbyP Offline
        Paul ColbyP Offline
        Paul Colby
        wrote on last edited by
        #7

        Hi @JacobNovitsky ,

        Your userDll.pro file appears to be missing a LIBS += line that would be pointing the the build output of the MyLib.pro file (ie the *.so files).

        See the end of this page for some inspiration, ie this bit:

        win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/release/ -lmylib
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/debug/ -lmylib
        else:unix: LIBS += -L$$OUT_PWD/../../../projects/mylib/ -lmylib
        INCLUDEPATH += $$PWD/../../../projects/mylib
        DEPENDPATH += $$PWD/../../../projects/mylib
        win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/release/mylib.lib
        else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/debug/mylib.lib
        else:unix: PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/libmylib.a
        

        Alternatively, since this seems to be a new project, I'd highly recommend you use cmake instead.

        Cheers.

        J 1 Reply Last reply
        1
        • Paul ColbyP Paul Colby

          Hi @JacobNovitsky ,

          Your userDll.pro file appears to be missing a LIBS += line that would be pointing the the build output of the MyLib.pro file (ie the *.so files).

          See the end of this page for some inspiration, ie this bit:

          win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/release/ -lmylib
          else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/debug/ -lmylib
          else:unix: LIBS += -L$$OUT_PWD/../../../projects/mylib/ -lmylib
          INCLUDEPATH += $$PWD/../../../projects/mylib
          DEPENDPATH += $$PWD/../../../projects/mylib
          win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/release/mylib.lib
          else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/debug/mylib.lib
          else:unix: PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/libmylib.a
          

          Alternatively, since this seems to be a new project, I'd highly recommend you use cmake instead.

          Cheers.

          J Offline
          J Offline
          JacobNovitsky
          wrote on last edited by
          #8

          @Paul-Colby I need to make DLL for my project build with qmake, but thanks for pointing out

          should I add to MyLib.pro lines below?

          win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/release/ -lmylib
          else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/debug/ -lmylib
          else:unix: LIBS += -L$$OUT_PWD/../../../projects/mylib/ -lmylib
          INCLUDEPATH += $$PWD/../../../projects/mylib
          DEPENDPATH += $$PWD/../../../projects/mylib
          win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/release/mylib.lib
          else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/debug/mylib.lib
          else:unix: PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/libmylib.a

          jsulmJ 1 Reply Last reply
          0
          • J JacobNovitsky

            @Paul-Colby I need to make DLL for my project build with qmake, but thanks for pointing out

            should I add to MyLib.pro lines below?

            win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/release/ -lmylib
            else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/debug/ -lmylib
            else:unix: LIBS += -L$$OUT_PWD/../../../projects/mylib/ -lmylib
            INCLUDEPATH += $$PWD/../../../projects/mylib
            DEPENDPATH += $$PWD/../../../projects/mylib
            win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/release/mylib.lib
            else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/debug/mylib.lib
            else:unix: PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/libmylib.a

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #9

            @JacobNovitsky said in Can not create/use DLL:

            should I add to MyLib.pro lines below?

            No, to userDll.pro as @Paul-Colby wrote

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            J 1 Reply Last reply
            0
            • jsulmJ jsulm

              @JacobNovitsky said in Can not create/use DLL:

              should I add to MyLib.pro lines below?

              No, to userDll.pro as @Paul-Colby wrote

              J Offline
              J Offline
              JacobNovitsky
              wrote on last edited by JacobNovitsky
              #10

              @jsulm great, ty

              build folder
              home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
              source files folder
              /home/supernova/MyLib

              I'm I correct:
              "If I use Ubuntu, I can somehow ignore win32 lines and keep it as in asample -> rest to be amended EXACTlLY like that".

              win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/release/ -lmylib
              else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/debug/ -lmylib
              else:unix: LIBS += -L$$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug -lmylib
              INCLUDEPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
              DEPENDPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
              win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/release/mylib.lib
              else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/debug/mylib.lib
              else:unix: PRE_TARGETDEPS += $$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug

              Please confirm, big thanks in advance

              jsulmJ 1 Reply Last reply
              0
              • J JacobNovitsky

                @jsulm great, ty

                build folder
                home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                source files folder
                /home/supernova/MyLib

                I'm I correct:
                "If I use Ubuntu, I can somehow ignore win32 lines and keep it as in asample -> rest to be amended EXACTlLY like that".

                win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/release/ -lmylib
                else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/debug/ -lmylib
                else:unix: LIBS += -L$$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug -lmylib
                INCLUDEPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                DEPENDPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/release/mylib.lib
                else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/debug/mylib.lib
                else:unix: PRE_TARGETDEPS += $$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug

                Please confirm, big thanks in advance

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #11

                @JacobNovitsky If you don't plan to build for Windows then you can remove all the win32 lines, but don't forget to alter other lines (like removing else:).

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                J 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @JacobNovitsky If you don't plan to build for Windows then you can remove all the win32 lines, but don't forget to alter other lines (like removing else:).

                  J Offline
                  J Offline
                  JacobNovitsky
                  wrote on last edited by
                  #12

                  @jsulm is this correct?

                  LIBS += -L$$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug -lmylib
                  INCLUDEPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                  DEPENDPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                  PRE_TARGETDEPS += $$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug

                  Not sure If i need to include project source files, if need please advise where to include

                  jsulmJ 1 Reply Last reply
                  0
                  • J JacobNovitsky

                    @jsulm is this correct?

                    LIBS += -L$$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug -lmylib
                    INCLUDEPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                    DEPENDPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                    PRE_TARGETDEPS += $$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug

                    Not sure If i need to include project source files, if need please advise where to include

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #13

                    @JacobNovitsky said in Can not create/use DLL:

                    Not sure If i need to include project source files

                    If you want to link against a pre build lib then of course you do not have to include the lib sources in the project which links against it.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    J 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @JacobNovitsky said in Can not create/use DLL:

                      Not sure If i need to include project source files

                      If you want to link against a pre build lib then of course you do not have to include the lib sources in the project which links against it.

                      J Offline
                      J Offline
                      JacobNovitsky
                      wrote on last edited by
                      #14

                      just delete both projects and created new

                      pro:

                      QT -= gui

                      TEMPLATE = lib
                      DEFINES += MYLIB_LIBRARY

                      CONFIG += c++17

                      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 +=
                      mylib.cpp

                      HEADERS +=
                      MyLib_global.h
                      mylib.h

                      LIBS += -L$$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug -lmylib
                      

                      INCLUDEPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                      DEPENDPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                      PRE_TARGETDEPS += $$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug

                      Default rules for deployment.

                      unix {
                      target.path = /usr/lib
                      }
                      !isEmpty(target.path): INSTALLS += target

                      compile output:
                      :-1: error: No rule to make target '/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug', needed by 'libMyLib.so.1.0.0'. Stop.

                      path correct, supernova@supernova-BOHB-WAX9:~/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug$ ls
                      libMyLib.so libMyLib.so.1.0 Makefile
                      libMyLib.so.1 libMyLib.so.1.0.0 mylib.o

                      please assist

                      J 1 Reply Last reply
                      0
                      • J JacobNovitsky

                        just delete both projects and created new

                        pro:

                        QT -= gui

                        TEMPLATE = lib
                        DEFINES += MYLIB_LIBRARY

                        CONFIG += c++17

                        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 +=
                        mylib.cpp

                        HEADERS +=
                        MyLib_global.h
                        mylib.h

                        LIBS += -L$$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug -lmylib
                        

                        INCLUDEPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                        DEPENDPATH += $$PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                        PRE_TARGETDEPS += $$OUT_PWD/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug

                        Default rules for deployment.

                        unix {
                        target.path = /usr/lib
                        }
                        !isEmpty(target.path): INSTALLS += target

                        compile output:
                        :-1: error: No rule to make target '/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug', needed by 'libMyLib.so.1.0.0'. Stop.

                        path correct, supernova@supernova-BOHB-WAX9:~/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug$ ls
                        libMyLib.so libMyLib.so.1.0 Makefile
                        libMyLib.so.1 libMyLib.so.1.0.0 mylib.o

                        please assist

                        J Offline
                        J Offline
                        JacobNovitsky
                        wrote on last edited by
                        #15

                        any ideas how to fix that?
                        compile output:
                        :-1: error: No rule to make target '/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug', needed by 'libMyLib.so.1.0.0'. Stop.

                        SGaistS 1 Reply Last reply
                        0
                        • J JacobNovitsky

                          any ideas how to fix that?
                          compile output:
                          :-1: error: No rule to make target '/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug', needed by 'libMyLib.so.1.0.0'. Stop.

                          SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #16

                          Remove $$PWD from the corresponding lines.

                          Side question: are you going to use that library in any other project ?

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          J 1 Reply Last reply
                          1
                          • SGaistS SGaist

                            Remove $$PWD from the corresponding lines.

                            Side question: are you going to use that library in any other project ?

                            J Offline
                            J Offline
                            JacobNovitsky
                            wrote on last edited by JacobNovitsky
                            #17

                            @SGaist not this, but after I learn how to use this, I gonna use it, for sure

                            J 1 Reply Last reply
                            0
                            • J JacobNovitsky

                              @SGaist not this, but after I learn how to use this, I gonna use it, for sure

                              J Offline
                              J Offline
                              JacobNovitsky
                              wrote on last edited by
                              #18

                              @SGaist side question too :)
                              where can I read about QMAKE?

                              SGaistS 1 Reply Last reply
                              0
                              • J JacobNovitsky

                                @SGaist side question too :)
                                where can I read about QMAKE?

                                SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #19

                                In the qmake manual

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                J 1 Reply Last reply
                                1
                                • SGaistS SGaist

                                  In the qmake manual

                                  J Offline
                                  J Offline
                                  JacobNovitsky
                                  wrote on last edited by
                                  #20

                                  Libtest.pro
                                  QT = core

                                  CONFIG += c++17 cmdline

                                  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 +=
                                  main.cpp

                                  Default rules for deployment.

                                  qnx: target.path = /tmp/$${TARGET}/bin
                                  else: unix:!android: target.path = /opt/$${TARGET}/bin
                                  !isEmpty(target.path): INSTALLS += target

                                  LIBS +=/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                  INCLUDEPATH +=/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                  DEPENDPATH +=/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                  PRE_TARGETDEPS +=/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug

                                  MyLib.pro

                                  QT -= gui

                                  TEMPLATE = lib
                                  DEFINES += MYLIB_LIBRARY

                                  CONFIG += c++17

                                  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 +=
                                  mylib.cpp

                                  HEADERS +=
                                  MyLib_global.h
                                  mylib.h

                                  Default rules for deployment.

                                  unix {
                                  target.path = /usr/lib
                                  }
                                  !isEmpty(target.path): INSTALLS += target

                                  :-1: error: cannot find /home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug: file format not recognized

                                  How to fix error above? There is still no DLL, if I comply with syntax, shall I get dll?

                                  jsulmJ 1 Reply Last reply
                                  0
                                  • J JacobNovitsky

                                    Libtest.pro
                                    QT = core

                                    CONFIG += c++17 cmdline

                                    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 +=
                                    main.cpp

                                    Default rules for deployment.

                                    qnx: target.path = /tmp/$${TARGET}/bin
                                    else: unix:!android: target.path = /opt/$${TARGET}/bin
                                    !isEmpty(target.path): INSTALLS += target

                                    LIBS +=/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                    INCLUDEPATH +=/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                    DEPENDPATH +=/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                    PRE_TARGETDEPS +=/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug

                                    MyLib.pro

                                    QT -= gui

                                    TEMPLATE = lib
                                    DEFINES += MYLIB_LIBRARY

                                    CONFIG += c++17

                                    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 +=
                                    mylib.cpp

                                    HEADERS +=
                                    MyLib_global.h
                                    mylib.h

                                    Default rules for deployment.

                                    unix {
                                    target.path = /usr/lib
                                    }
                                    !isEmpty(target.path): INSTALLS += target

                                    :-1: error: cannot find /home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug: file format not recognized

                                    How to fix error above? There is still no DLL, if I comply with syntax, shall I get dll?

                                    jsulmJ Offline
                                    jsulmJ Offline
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #21

                                    @JacobNovitsky You should really read the link @SGaist gave you.
                                    In LIBS you need to also specify the lib you want to link.

                                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    J 1 Reply Last reply
                                    0
                                    • jsulmJ jsulm

                                      @JacobNovitsky You should really read the link @SGaist gave you.
                                      In LIBS you need to also specify the lib you want to link.

                                      J Offline
                                      J Offline
                                      JacobNovitsky
                                      wrote on last edited by
                                      #22

                                      @jsulm if I use in the LIBS line something with prefix -lmylib it does not work :)
                                      what should I exactly insert to LIBS line?

                                      J 1 Reply Last reply
                                      0
                                      • J JacobNovitsky

                                        @jsulm if I use in the LIBS line something with prefix -lmylib it does not work :)
                                        what should I exactly insert to LIBS line?

                                        J Offline
                                        J Offline
                                        JacobNovitsky
                                        wrote on last edited by JacobNovitsky
                                        #23

                                        changed to

                                            LIBS += -L/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug -lMyLib
                                            INCLUDEPATH += /home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                            DEPENDPATH += /home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                            PRE_TARGETDEPS += /home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                        

                                        it builds, but how to gett .dll file?

                                        J SGaistS 2 Replies Last reply
                                        0
                                        • J JacobNovitsky

                                          changed to

                                              LIBS += -L/home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug -lMyLib
                                              INCLUDEPATH += /home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                              DEPENDPATH += /home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                              PRE_TARGETDEPS += /home/supernova/build-MyLib-Desktop_Qt_6_2_4_GCC_64bit-Debug
                                          

                                          it builds, but how to gett .dll file?

                                          J Offline
                                          J Offline
                                          JacobNovitsky
                                          wrote on last edited by JacobNovitsky
                                          #24

                                          If I just link header which includes other project headers, it means my program auto include all headers which increase building and execution time?
                                          same going to happen if I use dll, I'm I correct?

                                          SGaistS 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