Results 1 to 7 of 7

Thread: Help Me!!

  1. #1
    Guest

    Help Me!!

    I get the following error in vc++ 6 when linking and cannot continue, rebuilding (all) and cleaning does not help!!!!

    Linking...
    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/Lesson1.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

  2. #2
    Member Newbie
    Join Date
    Jul 2002
    Posts
    37

    Re: Help Me!!

    You seem to be using the wrong type of project. If you are using GLUT then (I think) that you need to have a Win32 console application. If you are not using GLUT then a Win32 application is the type of project that you need.

    Good luck
    Kevin

  3. #3
    Member Newbie
    Join Date
    Aug 2002
    Posts
    42

    Re: Help Me!!

    Of course doing a clean build didn't fix it. You created a console app, and you have NO MAIN FUNCTION!

    Say it with me...

    Win32 Console app = main() entry point
    Win32 Application = WinMain() entry point

    Any questions?

  4. #4
    Senior Member Frequent Contributor marcus256's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    764

    Re: Help Me!!

    You can also force entry point (I prefer main(), since it's more portable than WinMain), regardless if you're building a Console or Windows app.

    The command line flag for using main() is:

    /entry:mainCRTStartup

    There is probably a similar setting accessible from the IDE too.

    Now you can use main() - always (for building GLUT Windows applications too)!

  5. #5
    Guest

    Re: Help Me!!

    The thing is, it is already a WinMain() function. Anyone got any other suggestions???

  6. #6
    Senior Member Regular Contributor
    Join Date
    Aug 2001
    Location
    England
    Posts
    173

    Re: Help Me!!

    It may well be a WinMain() function - but is that in a project type of "Win32 console Application" or "Win32 Application"

    The "console" part is important!

    Look at what Latrans said!

    -Mezz

  7. #7
    Guest

    Re: Help Me!!

    Stupid, Stupid, Stupid. (Bashes Head Against Desk)!!!

    I started a new project (Win32 App), added a C++ source file, copied the code and presto. It worked.

    Thanks!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean