PDA

View Full Version : Link Error



neru
10-02-2004, 05:11 AM
Hi,all. I downloaded some code from Nehe.
And found the following message when I link it:

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

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

I had imported opengl32.lib,glu32.lib,glut32.lib into my project.I used VC++6.0 to run the code.
What did I miss?

ZbuffeR
10-02-2004, 09:30 AM
If you have no "main" in a C program, you probably have a WinMain somewhere, and you need to set your compiler to compile a "windows program" instead of a "command line prog".

This is not opengl, this C/C++ programming.

10-06-2004, 03:02 AM
Sorry.Forgive me.

I really found the winmain function.
But how to set my compiler to compile a "windows program" instead of a "command line prog".

I'm new to opengl and new to C++,too.
I use VC++6.0 to compile the code.
Thank you for your help!!

dvm
10-06-2004, 04:22 AM
For a windows program you should create a Win32 application. For a console app you should create a Win32 console application.