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. C++ constant static vector instantiation
Forum Update on Monday, May 27th 2025

C++ constant static vector instantiation

Scheduled Pinned Locked Moved Solved General and Desktop
15 Posts 5 Posters 966 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.
  • faiszalkhanF faiszalkhan

    @SGaist Can you please provide a link to an article/Documentation which you think would help me out. Thank you very much.

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

    @faiszalkhan https://doc.qt.io/qt-5/third-party-libraries.html
    Hint: -lLIBNAME is missing in your pro file.

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

    faiszalkhanF 1 Reply Last reply
    4
    • jsulmJ jsulm

      @faiszalkhan https://doc.qt.io/qt-5/third-party-libraries.html
      Hint: -lLIBNAME is missing in your pro file.

      faiszalkhanF Offline
      faiszalkhanF Offline
      faiszalkhan
      wrote on last edited by
      #7

      @jsulm @SGaist I checked the documentation, found it straightforward and made the changes but I'm still not able to get past this issue. I changed the command to :

      LIBS += -L"third_party/license++/exe" -lliblicensepp
      

      I'm compiling on macOS with QT creator 5.9. I tried all the permutations and combinations for the path but it doesn't seem to work.

      Error :

      ld: warning: directory not found for option '-Lthird_party/license++/exe'
      ld: library not found for -lliblicensepp
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      

      Please help.

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #8

        @faiszalkhan said in C++ constant static vector instantiation:

        LIBS += -L"third_party/license++/exe" -lliblicensepp

        Hint: -lLIBNAME is missing in your pro file.

        I don't think your libname is '-L"third_party/license++/exe" -lliblicensepp' but licensepp ...

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

        faiszalkhanF 1 Reply Last reply
        1
        • Christian EhrlicherC Christian Ehrlicher

          @faiszalkhan said in C++ constant static vector instantiation:

          LIBS += -L"third_party/license++/exe" -lliblicensepp

          Hint: -lLIBNAME is missing in your pro file.

          I don't think your libname is '-L"third_party/license++/exe" -lliblicensepp' but licensepp ...

          faiszalkhanF Offline
          faiszalkhanF Offline
          faiszalkhan
          wrote on last edited by
          #9

          @Christian-Ehrlicher The name of the library is liblicensepp.dylib. I have prepended "-l" as mentioned in the documentation mentioned above.

          1 Reply Last reply
          0
          • Kent-DorfmanK Offline
            Kent-DorfmanK Offline
            Kent-Dorfman
            wrote on last edited by
            #10

            when using -l{libname} you don't generally write -llib{libname} but just -l{libname}

            -lmath is right, where -llibmath is wrong

            1 Reply Last reply
            3
            • faiszalkhanF Offline
              faiszalkhanF Offline
              faiszalkhan
              wrote on last edited by
              #11

              @Kent-Dorfman Thank you for that. I made the change as follows

              LIBS += -L"third_party/license++/exe" -llicensepp
              

              Same error :(

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #12

                The name of the library is liblicensepp.dylib.

                No, the name is licensepp, the filename of the library is 'liblicensepp.dylib' (or 'liblicensepp.so' on linux or licensepp.dll on windows).

                The directory should be absolute or correctly relative (which isn't as the compiler tells you).

                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
                2
                • faiszalkhanF Offline
                  faiszalkhanF Offline
                  faiszalkhan
                  wrote on last edited by
                  #13

                  @Christian-Ehrlicher thanks. Providing the absolute path worked. However, I'm not sure why the relative directory path doesn't work as it is straight forward. The relative path I give is relative wrt the .pro file as has been done for the headers and sources.

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #14

                    @faiszalkhan said in C++ constant static vector instantiation:

                    relative wrt the .pro file as has been done for the headers and sources.

                    it must be the relative one on where the linker is called.

                    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
                    1
                    • faiszalkhanF Offline
                      faiszalkhanF Offline
                      faiszalkhan
                      wrote on last edited by faiszalkhan
                      #15

                      @jsulm @SGaist @Christian-Ehrlicher @Kent-Dorfman Thank you very much.

                      1 Reply Last reply
                      1

                      • Login

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