Thread: what ooes this error mean?

  1. #1
    Registered User
    Join Date
    Aug 2011

    what ooes this error mean?

    error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

  2. #2
    Registered User
    Join Date
    Aug 2011
    and how to resolve it?

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Perhaps you forgot to define the global main function.
    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

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    You need to make sure you're compiling a "console" program (which expects main()), or a GUI program (which expects WinMain())
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Join Date
    Oct 2007
    Inside my computer
    IIRC, goto project options -> c/c++ -> linker -> system -> find option subsystem, set to console.
    This is taken from memory because I don't have the IDE to check right now. But it's there somewhere.
    Or you can create a new project and copy your files over. Be sure to select a win32 console project.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 15
    Last Post: 11-28-2011, 11:48 AM
  2. Replies: 4
    Last Post: 07-24-2011, 09:38 PM
  3. Replies: 1
    Last Post: 11-15-2010, 11:14 AM
  4. Replies: 3
    Last Post: 10-02-2007, 09:12 PM
  5. Compiler error error C2065: '_beginthreadex; : undeclared identifier
    By Roaring_Tiger in forum Windows Programming
    Replies: 3
    Last Post: 04-29-2003, 01:54 AM