Thread: Error with book or compiler?

  1. #1
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765

    Exclamation Error with book or compiler?

    I've recently started to try and code windows programs but there's something wrong...

    When I try to run the program, I get the following error:

    Error: a.cpp(24,24):Cannot convert 'long (__stdcall *)(void *,unsigned int,unsigned short,long)' to 'long (__stdcall *)(void *,unsigned int,unsigned int,long)'

    I then commented out the "problem" line and tried to run it again only to get another eror:

    Error: Error: Unresolved external '_main' referenced from D:\APPS\PROGRAMMING\BC5\LIB\C0X32.OBJ

    I don't know if the problem lies with the compiler or if the book is wrong. I copied the example exactly out of the book : Turbo C/C++ the complete reference second edition.

    here's my source if you guys want to take a look
    Last edited by biosninja; 08-01-2002 at 01:37 AM.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Code:
    long far pascal WindowFunc(HWND hwnd, WORD message, WORD wParam,long lParam)
    This is old....try this instead



    Code:
    LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. URGENT: Help wanted...in C
    By iamjimjohn in forum C Programming
    Replies: 16
    Last Post: 05-18-2007, 05:46 AM
  2. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  3. Please Help!!!!!
    By princssashes in forum C# Programming
    Replies: 2
    Last Post: 04-05-2006, 08:18 AM
  4. I"m selling a book...
    By St0rmTroop3er in forum Game Programming
    Replies: 2
    Last Post: 12-13-2003, 01:55 PM
  5. Compiler Design... Anyone That Can Help!
    By ComputerNerd888 in forum C++ Programming
    Replies: 3
    Last Post: 09-27-2003, 09:48 AM