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…?

i also included libcd.lib and still nothing…

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.

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:
[b]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…?[/b]

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.

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.