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

This is a discussion on HELP with this pls : undefined reference to 'WinMain@16' within the C++ Programming forums, part of the General Programming Boards category; Im new in programing and while I was making the .cpp file to this header: here is the .cpp file: ...

  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:

    Name:  h.png
Views: 265
Size:  6.7 KB

    here is the .cpp file:

    Name:  cpp.png
Views: 388
Size:  14.2 KB

    i got this error:

    Name:  error winmain.png
Views: 207
Size:  8.2 KB

    What can I do??

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,628
    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
    "I Win!" by U. Lose vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,754
    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
    To be or not to be == true

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, 08: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


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