Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Linux Qt Creator compiling third party library problem
Forum Updated to NodeBB v4.3 + New Features

Linux Qt Creator compiling third party library problem

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 2 Posters 1.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.
  • M Offline
    M Offline
    mireiner
    wrote on last edited by mireiner
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4
      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
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        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
        0
        • M Offline
          M Offline
          mireiner
          wrote on last edited by mireiner
          #3

          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
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4
            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
            1
            • M Offline
              M Offline
              mireiner
              wrote on last edited by mireiner
              #5

              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
              1

              • Login

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