Compile error - Reference to `WinMain@16'

This is a discussion on Compile error - Reference to `WinMain@16' within the Windows Programming forums, part of the Platform Specific Boards category; [Linker error] undefined reference to `WinMain@16' what is that??? and how can I fix it ? I'm using Bloodshed Dev-C++ ...

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    20

    Compile error - Reference to `WinMain@16'

    [Linker error] undefined reference to `WinMain@16'

    what is that??? and how can I fix it ?

    I'm using Bloodshed Dev-C++ compiler, and I've included:

    <windows.h>
    <iostream>
    <string>

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,262
    Are you making a Windows-based (GUI) or console program? If the former is true, then make sure you have the WinMain entry-point function where you may have int main(...). If not, check your project settings in your IDE.

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    20
    I'm making a simple console program where you kan move a symbol (the ASCII smiley guy - int 2 converted)around a black screen using the keyboard... I'll attach the .cpp file and the .h file
    Attached Files Attached Files

  4. #4
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    If you're making a console program, you probably won't need <windows.h>. Also, make sure that your program knows it's a console and not a windows app. Since it's looking for "WinMain," it must think that it is a windows app.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C and C++ compile speed
    By swgh in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-02-2007, 01:37 PM
  2. Compile as you type
    By Rocketmagnet in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 12-07-2006, 12:36 PM
  3. How to compile mfc libs from platform sdk
    By tjcbs in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2006, 07:20 AM
  4. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 08:05 PM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 01:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21