Thread: HELP with this pls : undefined reference to 'WinMain@16'

  1. #1
    Registered User
    Join Date
    Sep 2013
    Posts
    1

    HELP with this pls : undefined reference to 'WinMain@16'

    Im new in programing and while I was making the .cpp file to this header:

    HELP with this pls : undefined reference to 'WinMain@16'-h-png

    here is the .cpp file:

    HELP with this pls : undefined reference to 'WinMain@16'-cpp-png

    i got this error:

    HELP with this pls : undefined reference to 'WinMain@16'-error-winmain-png

    What can I do??

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    You forgot to write your global main function.

    By the way, in the future, instead of posting a screenshot of your code, post your code in [code][/code] bbcode tags.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    You created a project of type "Windows Application" - it looks for WinMain function as a start point

    You need to create "Windows Console Application" project - it will have a main function as a start point
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. undefined reference to 'WinMain@16'
    By loopback0 in forum C Programming
    Replies: 5
    Last Post: 03-18-2012, 03:28 PM
  2. 'undefined reference to WinMain@16'
    By lancehumiston in forum C++ Programming
    Replies: 3
    Last Post: 02-29-2012, 09:51 PM
  3. Undefined Reference to 'WinMain@16'
    By Mossypne in forum C Programming
    Replies: 3
    Last Post: 08-04-2010, 07:16 AM
  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