what ooes this error mean?

This is a discussion on what ooes this error mean? within the C++ Programming forums, part of the General Programming Boards category; error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup...

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    384

    what ooes this error mean?

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

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

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,717
    Perhaps you forgot to define the global main function.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,594
    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, 10:48 AM
  2. Replies: 4
    Last Post: 07-24-2011, 09:38 PM
  3. Replies: 1
    Last Post: 11-15-2010, 10: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

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