Results 1 to 7 of 7

Thread: Urgent! error: `setdefaultif’ undeclared (first use this function)

  1. #1
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    3

    Unhappy Urgent! error: `setdefaultif’ undeclared (first use this function)

    Hi
    I’m using QT 4.6 on Symbian SDK 5. and when I import the ftp example and compile it keeps popping up a wrong message “error: `setdefaultif’ undeclared (first use this function)” and the function ’setdefaultif’ is in grey, which means it is not defined.

    I import the ftp example from QT\example\network\ftp and I check the "Phone Release (GCCE) [S60_5th_Edition_SDK_v1.0]" and "Emulator Debug (WINSCW) [S60_5th_Edition_SDK_v1.0]".


    any idea?

  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: Urgent! error: `setdefaultif’ undeclared (first use this function)

    Don't use "Urgent" and similar in your subject, it is only counter productive.
    We all are helping each other here, and no one owes you anything.

    Do you have #include <net/if.h> included in the code that uses setdefaultif()?
    ==========================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. The following user says thank you to high_flyer for this useful post:

    coco (19th January 2010)

  4. #3
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    3

    Default Re: Urgent! error: `setdefaultif’ undeclared (first use this function)

    Archimedes, thank you for reminding me. sorry about that.

    I don't know is there is version difference of "if.h" , mine has no function called "setdefaultif" and further more, another error is "there is no property 'snap_id' in struct ifreq". I attached the snap shot grabbed from my carbide IDE.
    Attachment 4164

    by the way, I import the Qt ftp example, and it show exactly the same problem

  5. #4
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    3

    Default Re: Urgent! error: `setdefaultif’ undeclared (first use this function)

    I think I also found where go wrong on my environment.
    I downloaded the latest OPEN C 1.6 plug-in and install. in the setup window,I choose S60 5th Edition SDK V1.0 and punch next. but it seem not install the plug-in and not showing any wrong message. I know that because I found no file is actually installed(please checked out ). In order to make sure, I install again, and this time I choose 3rd Edition FP1 SDK and it goes well(). and the most weird part is, the plugin will only get installed when I choose S60 3rd Edition FP1. none of others will succeed. My guess is there are some restriction on the 1.6 plugin setup.

  6. #5
    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: Urgent! error: `setdefaultif’ undeclared (first use this function)

    It is clear you have an environment problem, but its hard to say what it is or what is the cause.
    Can you compile a simple hello world Qt application?
    Can you check if your Qt is configured with the network module, and if your project and linking against it?
    ==========================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. #6
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    3

    Default Re: Urgent! error: `setdefaultif’ undeclared (first use this function)

    Quote Originally Posted by high_flyer View Post
    It is clear you have an environment problem, but its hard to say what it is or what is the cause.
    Can you compile a simple hello world Qt application?
    Can you check if your Qt is configured with the network module, and if your project and linking against it?
    yes, I'm working project on NOKIA N97 mini, other codes go well on my environment. and also, the Qt ftp example can be compiled sucessfully when NOKIA Open C/C++ 1.6 plugin installed.

    I double checked the if.h in 1.6 version and in the SDK 5 version. the SDK 5 version dosen't have setdefaultif() function. if you replace the header file by the 1.6 version. it will get error when linking.

  8. #7
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    3

    Default Re: Urgent! error: `setdefaultif’ undeclared (first use this function)

    Problem solved!!!
    I think it is the problem of NOKIA Open C/C++ 1.6(1.5) setup program. The instalerl seems not able to recognize the short path like "D:\S60\devices\S60_5T~1.0" (in some microsoft OS version may do this) . Since the S60 SDK installer will add a sub dir call "S60_5th_Edition_SDK_v1.0", so there is no way you can avoid this problem by changing the install path.
    The solution is go to registry editor (your can type "regedit" in the command line window) , search the installed path, for example "D:\S60\devices\S60_5T~1.0" and rename it to full path(ex. D:\S60\devices\S60_5th_Edition_SDK_v1.0). but I recommend you backup your registry before u rename it, in case anything wrong happen. good luck!

Similar Threads

  1. QWaitCondition function wait() error
    By freekill in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2010, 02:54
  2. Replies: 0
    Last Post: 4th November 2009, 11:21
  3. no matching function error
    By arpspatel in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2009, 16:47
  4. Replies: 6
    Last Post: 24th June 2009, 15:27
  5. [URGENT] Weird compile error [URGENT]
    By MarkoSan in forum Qt Programming
    Replies: 3
    Last Post: 25th May 2008, 00:54

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.