Thread: 'undefined reference to WinMain@16'

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    22

    'undefined reference to WinMain@16'

    I'm trying to compile my first program that uses a class file and am getting a "undefined reference to WinMain@16" error. Does anyone know how to fix this? Thank you!

  2. #2
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    Sounds like you've set your project for a Windows program instead of a Console program.
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    If you are on MSVS change your subsystem to Console and add a main function.

  4. #4
    Registered User
    Join Date
    Apr 2011
    Posts
    22
    I'm writing my code in codeblocks 10.05. How would I change to a Console program?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 17
    Last Post: 07-08-2011, 07:11 AM
  2. Undefined Reference to 'WinMain@16'
    By Mossypne in forum C Programming
    Replies: 3
    Last Post: 08-04-2010, 07:16 AM
  3. [Linker error] undefined ref to winmain@16 HELP!!!
    By mramazing in forum C++ Programming
    Replies: 12
    Last Post: 05-03-2008, 10:06 PM
  4. undefined reference to `WinMain@16'
    By Marksman in forum C++ Programming
    Replies: 11
    Last Post: 09-29-2006, 06:32 AM
  5. compile: undefined reference to WinMain@16
    By Xarr in forum C++ Programming
    Replies: 3
    Last Post: 06-08-2004, 01:29 PM

Tags for this Thread