Thread: Download code

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Quote Originally Posted by Tonto
    >> You can also use HTTP API

    Yeah I linked to that, it's called the WinInet API. It's kind of a dirty .......... but it's pretty cool I guess. I don't think you really gave a solid attempt to look for resources yourself, but if you want the utter most basic winsock tutorial in the world, MSDN has it, under the name "Getting Started with Winsock". The code is commented, all the functions ref's are linked and explained, and there is simply nothing more complex than a Hello World. Looky here: http://msdn.microsoft.com/library/de...th_winsock.asp
    Ok, first error
    [Linker error] undefined reference to `WSAStartup@8'
    Another error
    4 C:\Programs\Dev-Cpp\Templates\main6.cpp `main' must return `int'
    Last edited by maxorator; 08-22-2005 at 11:45 PM.

  2. #2
    Banned
    Join Date
    Jun 2005
    Posts
    594
    Quote Originally Posted by maxorator
    4 C:\Programs\Dev-Cpp\Templates\main6.cpp `main' must return `int'

    main must start with int, and return a int,
    the following is a example on how main should be declared.

    Code:
    int main()
    {
    
         return 0;
    }
    for some applications you may need

    INT WINAPI MAIN()

    or

    int WINAPI MAIN()


    either way it shoudl start with int and return int.

    that will get rid of that error.

    for your other error your not linking to something correctly
    your prolyl doing a consoel application when you should
    be picking a windows application on devc++.

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    If all you want to do is download files clean and simple, the solution was already given in the third post.

    Code:
    URLDownloadToFile( NULL, "http://www.google.com/intl/en_us/images/logo.gif", "c:\\google_logo.jpg", 0, NULL );
    Check what headers and libs you need at the link given by Tonto. Make sure you check return values.

    Maybe socket programming is a bit over your head just now and all you need is this simplified functionality.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Quote Originally Posted by nvoigt
    If all you want to do is download files clean and simple, the solution was already given in the third post.

    Code:
    URLDownloadToFile( NULL, "http://www.google.com/intl/en_us/images/logo.gif", "c:\\google_logo.jpg", 0, NULL );
    Check what headers and libs you need at the link given by Tonto. Make sure you check return values.

    Maybe socket programming is a bit over your head just now and all you need is this simplified functionality.
    What header file do I need for that?

  5. #5
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Check what headers and libs you need at the link given by Tonto.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Proposal: Code colouring
    By Perspective in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 05-14-2007, 07:23 AM
  2. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 10:20 AM
  3. Is this right?(about a class) (code to download) etc..
    By knave in forum C++ Programming
    Replies: 0
    Last Post: 07-07-2003, 07:53 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM