×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    15

    undefined reference to `setdefaultif' in network examples

    Hi,
    this is a compile error for network examples: " undefined reference to `setdefaultif' ", when I try compile each example for symbian device by Qt creator 2.0.0 in NokiQtSdk v1.0.
    so what's or where's my wrong?

    this is fortunserver.pro for example
    ------------------------------------------------------------------
    HEADERS = server.h
    SOURCES = server.cpp \
    main.cpp
    QT += network

    # install
    target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
    sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fortuneserver.pro
    sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
    INSTALLS += target sources

    symbian {
    TARGET.UID3 = 0xA000CF71
    include($$[QT_INSTALL_EXAMPLES]/symbianpkgrules.pri)
    HEADERS += $$[QT_INSTALL_EXAMPLES]/network/qftp/sym_iap_util.h
    LIBS += -lesock -lcommdb -linsock # For IAP selection
    TARGET.CAPABILITY = "All -TCB"
    TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
    }

    ---------------------------------------------------------------------------------------------

  2. #2
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: undefined reference to `setdefaultif' in network examples

    hi,

    check if your missing the header and lib
    #include <net/if.h>
    libc.lib



    Regards,
    Mateen Maldar
    Last edited by mateen_maldar; 2010-07-21 at 07:10. Reason: missed info
    "Whatever the mind can conceive and believe, the mind can achieve"

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    15

    Re: undefined reference to `setdefaultif' in network examples

    Quote Originally Posted by mateen_maldar View Post
    hi,

    check if your missing the header and lib
    #include <net/if.h>
    libc.lib



    Regards,
    Mateen Maldar
    Well. It's qt example. so #include <net/if.h> is added in sym_iap_util.h and I add libc.lib in .pro but it didn't solve problem.

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: undefined reference to `setdefaultif' in network examples

    "undefined reference" generally means it failed in the link step -- the linker couldn't find the compiled version of the referenced item. This would generally mean you're missing something in SOURCES or missing a DLL/LIB.

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    15

    Re: undefined reference to `setdefaultif' in network examples

    Quote Originally Posted by danhicksbyron View Post
    "undefined reference" generally means it failed in the link step -- the linker couldn't find the compiled version of the referenced item. This would generally mean you're missing something in SOURCES or missing a DLL/LIB.
    Yes, I think it's about linker. But it's an example of NokiQtSdk v1.0 and I think it must be compile without error!!. Setdefaultif is open C function that it's used in sym_iap_util.h and I added libc.lib in .pro as "-llibc" and also "-Lc:\NokiaQtSDK\Symbian\SDK\epoc32\release\armv5\lib\libc.lib" but nothing happend.

    HEADERS = server.h
    SOURCES = server.cpp \
    main.cpp
    QT += network

    # install
    target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
    sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fortuneserver.pro
    sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
    INSTALLS += target sources

    symbian {
    TARGET.UID3 = 0xA000CF71
    include($$[QT_INSTALL_EXAMPLES]/symbianpkgrules.pri)
    HEADERS += $$[QT_INSTALL_EXAMPLES]/network/qftp/sym_iap_util.h
    LIBS += -lesock -lcommdb -linsock -llibc -Lc:\NokiaQtSDK\Symbian\SDK\epoc32\release\armv5\lib\libc.lib # For IAP selection
    TARGET.CAPABILITY = "All -TCB"
    TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
    }

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: undefined reference to `setdefaultif' in network examples

    I'm no expert at this, but I THINK you should drop the "libc.lib" from your -L. As I understand it that just specifies a search directory, not the specific file.

  7. #7
    Registered User
    Join Date
    Mar 2009
    Posts
    15

    Re: undefined reference to `setdefaultif' in network examples

    Ok. Yes sorry for my mistake writting, I used -L without libc.lib

    LIBS += -lesock -lcommdb -linsock libc.lib -Lc:\NokiaQtSDK\Symbian\SDK\epoc32\release\armv5\lib

    By the way, qmake generate .mmp file and all libs are exist.

    transferserver_0xA000CF71.mmp:


    LIBRARY insock.lib
    LIBRARY commdb.lib
    LIBRARY esock.lib
    LIBRARY libstdcpp.lib
    LIBRARY QtGui.lib
    LIBRARY QtNetwork.lib
    LIBRARY QtCore.lib
    LIBRARY libc.lib
    LIBRARY libm.lib
    LIBRARY euser.lib
    LIBRARY libdl.lib
    STATICLIBRARY qtmain.lib

    it seem all of thing is correct but the linker error still is exist.

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: undefined reference to `setdefaultif' in network examples

    Could be a C/C++ thing -- name mangling.

  9. #9
    Registered User
    Join Date
    Mar 2009
    Posts
    15

    Re: undefined reference to `setdefaultif' in network examples

    Thanks for replay. I think I found the problem. It's about NokiaQtSdk v1.0. Open C used in NokiaQtSdk is older also header files have setdefalultif (if.h) but the library (libc.lib) hasn't this function. This function is exist in openC 1.6.

Similar Threads

  1. Undefined reference...
    By Carthrat in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2010-07-16, 08:26
  2. undefined reference error
    By fatah3000 in forum Symbian
    Replies: 2
    Last Post: 2010-04-29, 20:54
  3. Undefined reference to AppView?!
    By Rafael T. in forum Symbian
    Replies: 7
    Last Post: 2008-11-24, 01:23
  4. Undefined reference...
    By parikhnirav.aits in forum Symbian
    Replies: 9
    Last Post: 2008-08-25, 20:08
  5. CTelephony undefined reference
    By frenchjt in forum Symbian
    Replies: 4
    Last Post: 2007-06-11, 18:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •