Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Spdlog library can't open in the Qt.
Forum Updated to NodeBB v4.3 + New Features

Spdlog library can't open in the Qt.

Scheduled Pinned Locked Moved Solved 3rd Party Software
20 Posts 5 Posters 3.6k Views 3 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.
  • S SGaist
    24 Aug 2021, 17:51

    Hi,

    Are you sure that these libs are static ? A .lib file can either be a static library or import library that will require the use of a dll at run time.

    J Offline
    J Offline
    JohanSolo
    wrote on 24 Aug 2021, 18:07 last edited by
    #11

    @SGaist said in Spdlog library can't open in the Qt.:

    Are you sure that these libs are static ? A .lib file can either be a static library or import library that will require the use of a dll at run time.

    The spdlog library is either header-only or static.

    `They did not know it was impossible, so they did it.'
    -- Mark Twain

    1 Reply Last reply
    0
    • S SGaist
      24 Aug 2021, 18:04

      Then start your application through the debugger to get a stack trace of the crash.

      E Offline
      E Offline
      Enes Alp
      wrote on 24 Aug 2021, 18:13 last edited by
      #12

      @SGaist
      The problem is in the spdlog::info function line. When I delete this line, I don't get errors.

      P 1 Reply Last reply 24 Aug 2021, 19:33
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 24 Aug 2021, 18:28 last edited by
        #13

        Do you have it working if you copy the code of the examples in the library documentation (without any Qt stuff) ?

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

        1 Reply Last reply
        0
        • E Enes Alp
          24 Aug 2021, 18:13

          @SGaist
          The problem is in the spdlog::info function line. When I delete this line, I don't get errors.

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 24 Aug 2021, 19:33 last edited by
          #14

          @Enes-Alp said in Spdlog library can't open in the Qt.:

          The problem is in the spdlog::info function line

          Have you tried the header-only approach?

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Enes Alp
            wrote on 24 Aug 2021, 22:04 last edited by
            #15

            Yes, I tried but I get the same result.

            #include <spdlog/spdlog.h>
            
            int main() {
            
              spdlog::info("Welcome to spdlog");
            
              return 0;
            }
            
            QT -= gui
            
            CONFIG += c++11 console
            CONFIG -= app_bundle
            
            ##- spdlog installed by default c:/dev/vcpkg
            
            SPDLOG_ROOT = c:/dev/vcpkg/installed/x64-windows
            
            exists($$SPDLOG_ROOT) {
                LIBS        += -L$$SPDLOG_ROOT/lib -lspdlog -lfmt
            
                INCLUDEPATH += $$SPDLOG_ROOT/include
                DEPENDPATH += $$SPDLOG_ROOT/include
            
                DESTDIR_WIN = $$replace(DESTDIR, "/", "\\")
                SPDLOG_ROOT_WIN = $$replace(SPDLOG_ROOT, "/", "\\")
            }
            
            
            # 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
            `
            
            K 1 Reply Last reply 25 Aug 2021, 06:32
            0
            • E Enes Alp
              24 Aug 2021, 22:04

              Yes, I tried but I get the same result.

              #include <spdlog/spdlog.h>
              
              int main() {
              
                spdlog::info("Welcome to spdlog");
              
                return 0;
              }
              
              QT -= gui
              
              CONFIG += c++11 console
              CONFIG -= app_bundle
              
              ##- spdlog installed by default c:/dev/vcpkg
              
              SPDLOG_ROOT = c:/dev/vcpkg/installed/x64-windows
              
              exists($$SPDLOG_ROOT) {
                  LIBS        += -L$$SPDLOG_ROOT/lib -lspdlog -lfmt
              
                  INCLUDEPATH += $$SPDLOG_ROOT/include
                  DEPENDPATH += $$SPDLOG_ROOT/include
              
                  DESTDIR_WIN = $$replace(DESTDIR, "/", "\\")
                  SPDLOG_ROOT_WIN = $$replace(SPDLOG_ROOT, "/", "\\")
              }
              
              
              # 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
              `
              
              K Offline
              K Offline
              KroMignon
              wrote on 25 Aug 2021, 06:32 last edited by
              #16

              @Enes-Alp said in Spdlog library can't open in the Qt.:

              Yes, I tried but I get the same result.

              But you don't have change anything, so the result will still be the same.
              Header only approach means you add each spdlog header file in INCLUDES and remove spdlog from LIBS.

              It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

              E 1 Reply Last reply 25 Aug 2021, 10:01
              0
              • K KroMignon
                25 Aug 2021, 06:32

                @Enes-Alp said in Spdlog library can't open in the Qt.:

                Yes, I tried but I get the same result.

                But you don't have change anything, so the result will still be the same.
                Header only approach means you add each spdlog header file in INCLUDES and remove spdlog from LIBS.

                E Offline
                E Offline
                Enes Alp
                wrote on 25 Aug 2021, 10:01 last edited by
                #17

                @KroMignon

                The Header-only approach is working but how can I add a static link?

                INCLUDEPATH += C:/Users/enesa/Documents/Test-Qt-Cpp/include/spdlog/include
                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 25 Aug 2021, 18:56 last edited by
                  #18

                  The concept of header only librairies is that you do not have anything to link.

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

                  E 1 Reply Last reply 25 Aug 2021, 23:08
                  1
                  • S SGaist
                    25 Aug 2021, 18:56

                    The concept of header only librairies is that you do not have anything to link.

                    E Offline
                    E Offline
                    Enes Alp
                    wrote on 25 Aug 2021, 23:08 last edited by
                    #19

                    @SGaist

                    In the doc, the static lib version is much faster in compile time.
                    What is the meaning of this, you know?

                    dcd103a4-6988-4f41-a3a3-79558ac067c8-image.png

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 26 Aug 2021, 20:52 last edited by
                      #20

                      The header only library means that you do not have to link anything but this means that you will build everything you use from it on each build.

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

                      1 Reply Last reply
                      0

                      20/20

                      26 Aug 2021, 20:52

                      • Login

                      • Login or register to search.
                      20 out of 20
                      • First post
                        20/20
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved