Thread: error message

  1. #1
    Unregistered
    Guest

    error message

    I am making a basic window and keep getting the error:

    LIBCS(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debub/Practice.exe : fatal error LNK1120: 1 unresolved externals


    Anyone know a way to fix this?

    Thank you

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    I do not know if this is the problem, but the entrance function for Windows is WinMain and not main.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  3. #3
    Unregistered
    Guest
    Yeah, it is a winmain function. Actually its taken directly out of the windows programming for dummies book. Everything else is fine except that error.

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    When you created a new project you probably accidently selected Win32 Console Application instead of Win32 Application. To remedy this do as follows:

    Project->Settings
    Click the "Link" Tab

    At the bottom you will notice a window titled Project Options: , once here scroll down until you see the following line..
    /subsystem:_____
    I bet yours says /subsystem:console . change console to windows and you shall be fine.
    /subsystem:windows

    Hope this helps.

    P.S. - When that is set to console the compiler looks for main as the entry point, when set to windows it looks for WinMain.

Popular pages Recent additions subscribe to a feed