Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Solved Linux Qt Creator compiling third party library problem

    Tools
    2
    5
    806
    Loading More Posts
    • 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.
    • M
      mireiner last edited by mireiner

      Hi there,

      I'm a Linux beginner. When compiling a project with a third party static library (.a file) with Qt Creator 4.12.4 (Qt 5.15) following errors show up:

      //libswe.a(sweph.o): undefined reference to symbol 'dladdr@@GLIBC_2.2.5'
      /lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
      collect2: error: ld returned 1 exit status

      Does anyone know what is missing and can give me some help on this?

      Thanks in advance,
      mireiner

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        LIBS += -ldl
        

        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 Reply Quote 1
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          Where does that static library come from ?
          How what is built ?
          On which distribution ?

          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 Reply Quote 0
          • M
            mireiner last edited by mireiner

            Hello SGast,

            meanwhile I tried another distro - same problem. The tested distros are:

            Linux Mint 20 Cinnamon (Ubuntu based)
            Manjaro 20.03 KDE (Arch Linux based)

            On Intel i7 processor with integrated uhd 630 graphics.

            I doubt that the problem is related to the third party library. The problem is my poor understanding how to link needed Linux libraries to my Qt project.

            I took a look into a makefile that came with the third party library for testing proposes. And there is says:

            swemini: swemini.o libswe.a
            	$(CC) $(OP) -o swemini swemini.o -L. -lswe -lm -ldl
            

            Because I didn't include the last two Linux libraries -lm -ldl that might be the cause of the errors. But I don't know how to do that.

            Do you know these Linux libraries and how to include them into an Qt Creator project?

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              LIBS += -ldl
              

              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 Reply Quote 1
              • M
                mireiner last edited by mireiner

                Yes, problem solved.
                I'm a bit ashamed that it was so simple and I tried so hard and didn't get it.

                Thank you very much SGaist!

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post