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. [Solved]Undefined reference problem

[Solved]Undefined reference problem

Scheduled Pinned Locked Moved General and Desktop
11 Posts 3 Posters 3.9k 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.
  • K Offline
    K Offline
    koahnig
    wrote on 19 Sept 2013, 16:50 last edited by
    #2

    Do you link with the correct lib?

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SetBetterPass
      wrote on 19 Sept 2013, 17:02 last edited by
      #3

      The example gave me this error when run

      /root/static_im/qxmpp-0.7.6/examples/example_0_connected-build-desktop/example_0_connected: error while loading shared libraries: libqxmpp_d.so.0: cannot open shared object file: No such file or directory

      I've tried to add LIBS += -L/usr/local/lib to .pro file to tell linker where to find lib but it didn't help, will be probably the same problem in my own code, how can I force linker to look there for the lib file?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on 19 Sept 2013, 17:14 last edited by
        #4

        Upper case 'L' defines the path of the library, but need also to specify the static part of the lib with lower case 'l'. See "this":http://qt-project.org/doc/qt-5.0/qtdoc/qmake-variable-reference.html#libs

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SetBetterPass
          wrote on 19 Sept 2013, 19:25 last edited by
          #5

          changed it to LIBS += -L/usr/local/lib -lqxmpp_d but nothing happened, application still crashing with same message

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 19 Sept 2013, 19:52 last edited by
            #6

            Hi,

            There's something not clear, once you have a problem when compiling, then when running the application.

            So maybe a silly question but: are you sure you have libqxmpp_d.so.0 on your system ?

            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
            • S Offline
              S Offline
              SetBetterPass
              wrote on 19 Sept 2013, 21:01 last edited by
              #7

              yes, the libqxmpp_d.so.0 file is link to shared library libqxmpp_d.so.0.7.6 it's in same directory as the lib, /usr/local/lib

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 19 Sept 2013, 21:21 last edited by
                #8

                Just to make things clear: did you build your application successfully ?

                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
                • S Offline
                  S Offline
                  SetBetterPass
                  wrote on 19 Sept 2013, 21:32 last edited by
                  #9

                  yes, no error nor warning when building it, only when I run application it crashes with that error

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 19 Sept 2013, 21:35 last edited by
                    #10

                    Then you need to update LD_LIBRARY_PATH and make it point also to /usr/local/lib.

                    By the way, developing (and generally doing anything) as root user is very dangerous, you could end up destroying your OS.

                    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
                    • S Offline
                      S Offline
                      SetBetterPass
                      wrote on 20 Sept 2013, 14:03 last edited by
                      #11

                      Thank you really much this was exactly the problem, next time I'll know :)

                      1 Reply Last reply
                      0

                      11/11

                      20 Sept 2013, 14:03

                      • Login

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