Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User a_barvar's Avatar
    Join Date
    Mar 2009
    Posts
    15
    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
    Registered User mateen_maldar's Avatar
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,063
    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 a_barvar's Avatar
    Join Date
    Mar 2009
    Posts
    15
    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 danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    "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 a_barvar's Avatar
    Join Date
    Mar 2009
    Posts
    15
    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 danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    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 a_barvar's Avatar
    Join Date
    Mar 2009
    Posts
    15
    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 danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    Could be a C/C++ thing -- name mangling.

  9. #9
    Registered User a_barvar's Avatar
    Join Date
    Mar 2009
    Posts
    15
    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 C++
    Replies: 2
    Last Post: 2010-04-29, 20:54
  3. Undefined reference to AppView?!
    By Rafael T. in forum Symbian C++
    Replies: 7
    Last Post: 2008-11-24, 01:23
  4. Undefined reference...
    By parikhnirav.aits in forum Symbian C++
    Replies: 9
    Last Post: 2008-08-25, 20:08
  5. CTelephony undefined reference
    By frenchjt in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved