Looking for a tutorial - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Looking for a tutorial

I'm looking for a good tutorial on windows programming in C. I've been programming in dos for several years. I feel I have enough experiance to start in windows. I prefer C over C++, but I can handle either.

Comments

  • SunlightSunlight Posts: 186Member
    : I'm looking for a good tutorial on windows programming in C.

    http://sunlightd.virtualave.net/Windows/FAQ.html#Tutorials
    --
    [italic][blue]Sunlight[/blue][/italic]


  • BASIC FriendBASIC Friend Posts: 354Member
    Thanks




  • BASIC FriendBASIC Friend Posts: 354Member
    I started that tut and the second program gave me a linktime error. The Console program compiled just fine with Borland 5.5, but it was the GUI program that I can't link. I tried several things, but kept getting the same error.

    This code is straight out of the tut;

    [code]
    #include

    int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
    {
    MessageBox(NULL, "Hello world!", "Sample", MB_OK);
    return 0;
    }
    [/code]
    Here's the output from the compiler:
    [code]
    Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
    msgbox2.c:
    Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    Error: Unresolved external '_main' referenced from C:BORLANDBCC55LIBC0X32.OBJ
    [/code]

    Am I using the wrong compiler? Or am I just doing something wrong?





  • weiccoweicco Posts: 950Member
    I get the same error on M$ Visual C++ for reason I don't understand. If I start a new empty project and make a new c++ source file in it and try to compile it I get that error. But if I don't make new project, instead I just make new source file and compile that everything works ok.

    Or even better I use Linux + gcc and get rid of all those stupid errors and warnings :)

  • ColdShineColdShine Posts: 597Member
    When linking, add the user32.lib to import MessageBox().
    ________
    [size=1][b][grey]Cold[/grey][blue]Shine[/blue][/b][/size]


  • SunlightSunlight Posts: 186Member
    : I started that tut and the second program gave me a linktime error. The Console program compiled just fine with Borland 5.5, but it was the GUI program that I can't link. I tried several things, but kept getting the same error.

    Congratulations. You have just found a bug in that version f the tutorial, now corrected. Thanks.

    : Error: Unresolved external '_main' referenced from C:BORLANDBCC55LIBC0X32.OBJ

    http://sunlightd.virtualave.net/Windows/FAQ.html#UnresolvedMain
    --
    [italic][blue]Sunlight[/blue][/italic]


  • BASIC FriendBASIC Friend Posts: 354Member
    Thanks, It works now!

    I feel stupid.




Sign In or Register to comment.