Results 1 to 6 of 6

Thread: Linker Error

  1. #1
    Guest

    Linker Error

    I just started using opengl while reading this book i just got...i tried the simpliest program and i get 2 errors after i try to build it...

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

    openglhelloprog1.exe - 2 error(s), 0 warning(s)

    i have included glu32.lib, opengl and glaux and i dont know what i am missing....?

  2. #2
    Guest

    Re: Linker Error

    i also included libcd.lib and still nothing...

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Linker Error

    Take a look at what the message is telling you for a second... "unresolved external symbol _main" Do you have a main function? Probably not... You probably have a WinMain function. Can you figure out how to fix the problem yet? If not, do a search on these boards for "unresolved external symbol _main" and I'm sure you will find a LOT of other posts have already been made about this.
    Deiussum
    Software Engineer and OpenGL enthusiast

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Linker Error

    It would be more helpful for you to also post the name of the book and what compiler you are using.

    Also maybe you are using example code which is not a complete program, only a section of one.

    Originally posted by s0lus:
    I just started using opengl while reading this book i just got...i tried the simpliest program and i get 2 errors after i try to build it...

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

    openglhelloprog1.exe - 2 error(s), 0 warning(s)

    i have included glu32.lib, opengl and glaux and i dont know what i am missing....?

  5. #5
    Junior Member Newbie
    Join Date
    Oct 2002
    Location
    Minnetonka, MN, USA
    Posts
    28

    Re: Linker Error

    If it's a really simple program, you might want to just post the entire thing. Unless it's a copyrighted section of code, of course.
    void s(int&A,int&B){A^=B^=A^=B;}

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Linker Error

    It's a linker error, not a compiler error. Posting his code is not really necessary. He doesn't have a main method and the project he's using expects that for the entry point. Either he's using a program with a WinMain, or he's only got a program fragment, as nexusone stated.
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Linker error
    By Zhugie in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-18-2007, 12:29 PM
  2. Linker error
    By Loffen in forum OpenGL: Windows
    Replies: 1
    Last Post: 08-19-2005, 04:53 AM
  3. Linker Error
    By Suf in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-16-2002, 08:43 AM
  4. linker error need help!!!!!!!!!!!!!!!!!!!!!!!
    By incus in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 05-17-2002, 10:31 PM
  5. Linker error
    By JodoKaast in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-25-2002, 01:59 PM

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