Results 1 to 4 of 4

Thread: Linking error: libQtNetwork.so: undefined reference to `_freeifaddrs'

  1. #1
    Join Date
    Jan 2008
    Posts
    7
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Linking error: libQtNetwork.so: undefined reference to `_freeifaddrs'

    Hi,

    I am trying to compile an application but I get the following errors when linking:
    /home/inigom/qtopia/qtopia/lib/libQtNetwork.so: undefined reference to `_freeifaddrs'
    /home/inigom/qtopia/qtopia/lib/libQtNetwork.so: undefined reference to `_getifaddrs'
    There are no other errors.
    I have added QT += network to the .pro file so that it would use the network libraries.

    The program compiles fine if I don't use the -embedded option but fails if I add it. (I must use that option)

    Does anyone have any suggestion?
    Last edited by jpn; 31st March 2008 at 14:11. Reason: missing [quote] tags

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Linking error: libQtNetwork.so: undefined reference to `_freeifaddrs'

    A wild guess, try compiling Qtopia without such dependency by modifying configure-script:
    Qt Code:
    1. CFG_GETADDRINFO=auto
    2. CFG_IPV6IFNAME=auto
    3. CFG_GETIFADDRS=auto
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. CFG_GETADDRINFO=no
    2. CFG_IPV6IFNAME=no
    3. CFG_GETIFADDRS=no
    To copy to clipboard, switch view to plain text mode 
    and rebuild Qtopia.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    dacla (31st March 2008)

  4. #3
    Join Date
    Jan 2008
    Posts
    7
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default (Solved) Re: Linking error: libQtNetwork.so: undefined reference to `_freeifaddrs'

    I didn't know that the configure script could be modified in order to save these kind of problems. Your suggestion was really helpful and solved this issue.

  5. #4
    Join Date
    Jan 2008
    Posts
    7
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Linking error: libQtNetwork.so: undefined reference to `_freeifaddrs'

    1. CFG_GETADDRINFO=no
    2. CFG_IPV6IFNAME=no
    3. CFG_GETIFADDRS=no
    I want to know more about those flags modified in the configure script. If I disable them will it change the performance of the QNetwork classes? I have noticed some problems when trying to run applications with the QNetwork module's classes after modifying those flags. The linux kernel panics when I run them and the application exits.

Similar Threads

  1. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 18:33
  2. MS Sql native driver??
    By LordQt in forum Qt Programming
    Replies: 4
    Last Post: 9th October 2007, 14:41
  3. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 15:28
  4. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 20:15
  5. Strange error while using Q3Canvas
    By Kapil in forum Newbie
    Replies: 13
    Last Post: 15th June 2006, 20:36

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.