Results 1 to 9 of 9

Thread: Qt-embedded link failure: undefined reference

  1. #1
    Join Date
    Sep 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qt-embedded link failure: undefined reference

    Whe I use openembedded Qt-embedded SDK to link my Qt GUI application against my static library or ffmpeg shared lib, it fails. The libraries are there, I can not figure out why it still complains. Any idea?

    arm-angstrom-linux-gnueabi-g++ -Wl,-rpath-link,/home/tang/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi//usr/lib -o Aips main.o dataobject.o utils.o message.o qmlapplicationviewer.o moc_qmlapplicationviewer.o moc_dataobject.o moc_message.o -L/home/tang/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi//usr/lib -L/home/tang/Projects/OE/build/Aips/../tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib -lgplayer -lglib-2.0 -lavcodec -lavformat -lavutil -lvorbis -lvorbisenc -lspeex -lmp3lame -L/home/tang/Projects/OE/build/Aips/../tmp/sysroots/beagleboard-angstrom-linux-gnueabi/usr/lib/gstreamer-0.10 -lgstffmpeg -lgstticodecplugin -lQtDeclarativeE -lQtScriptE -lQtSvgE -lQtSqlE -lQtXmlPatternsE -lQtGuiE -lQtNetworkE -lQtCoreE -lpthread
    main.o: In function `QPlayer':
    /home/tang/Projects/OE/build/Aips/main.cpp:22: undefined reference to `av_register_all()'
    main.o: In function `QPlayer::run()':
    /home/tang/Projects/OE/build/Aips/main.cpp:28: undefined reference to `gplayer(_GList*)'
    collect2: ld returned 1 exit status

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt-embedded link failure: undefined reference

    The link error does not complain about not finding the libs - but not finding references in them.
    This is probably due to wrong version of the libs.
    You can use grep to see if the symbols really are missing in the respective libs.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Sep 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt-embedded link failure: undefined reference

    Quote Originally Posted by high_flyer View Post
    The link error does not complain about not finding the libs - but not finding references in them.
    This is probably due to wrong version of the libs.
    You can use grep to see if the symbols really are missing in the respective libs.
    Yes they are in.

    nm /home/tang/Projects/OE/build/Aips/../tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib/libgplayer.a | grep gplayer
    00000394 T gplayer
    00000000 t gplayer_callback
    nm ../tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib/libavformat.so |grep av_register_all
    00016910 T av_register_all

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt-embedded link failure: undefined reference

    Aren't you missing an -L here?:
    -L/home/tang/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi//usr/lib -L/home/tang/Projects/OE/build/Aips/../tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Sep 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt-embedded link failure: undefined reference

    Quote Originally Posted by high_flyer View Post
    Aren't you missing an -L here?:
    ../tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib is relative path against my work directory. No problem. I tried the same build for x86 platform with Qt creator.
    it still got same errors. That is strange!

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt-embedded link failure: undefined reference

    But without -L I am not sure it is considered as lib search path.
    Try
    -L../tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib
    I tried the same build for x86 platform with Qt creator.
    Just checking: you built these libs for your current target too, right?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Sep 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt-embedded link failure: undefined reference

    Quote Originally Posted by high_flyer View Post
    But without -L I am not sure it is considered as lib search path.
    Try
    -L../tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib

    Just checking: you built these libs for your current target too, right?
    You see -L is there -L/home/tang/Projects/OE/build/Aips/../tmp/sysroots/armv7a-angstrom-linux-gnueabi/usr/lib.
    I build for beagleboard. To figure out, I tried my build and libraries on x86 platform. But if I put gst_init() of gstreamer-0.10.so in my code. It has no problem.

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt-embedded link failure: undefined reference

    To figure out, I tried my build and libraries on x86 platform. But if I put gst_init() of gstreamer-0.10.so in my code. It has no problem.
    Do you only copy the libs between the platforms, or do you build them for each platform?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. #9
    Join Date
    Sep 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt-embedded link failure: undefined reference

    Quote Originally Posted by high_flyer View Post
    Do you only copy the libs between the platforms, or do you build them for each platform?
    I build them for different platform in different environment.

Similar Threads

  1. undefined reference
    By deepakswaroop in forum Newbie
    Replies: 1
    Last Post: 2nd March 2011, 06:46
  2. Replies: 3
    Last Post: 18th December 2010, 14:55
  3. Replies: 3
    Last Post: 13th November 2010, 08:06
  4. Qt/Embedded installation Failure
    By rakesh619 in forum Installation and Deployment
    Replies: 3
    Last Post: 15th August 2010, 14:57
  5. QCreator - undefined reference link errors
    By stodge in forum Newbie
    Replies: 2
    Last Post: 5th April 2009, 14:07

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.