PDA

View Full Version : realy beginner problem



08-21-2001, 09:15 AM
i get this error message when i execute my opengl program in microsoft C++

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

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


what is my problem

no-one
08-21-2001, 10:41 AM
your problem is your trying to use a console app when what you need is a
Win32 app...

or your just not defining the function
int main()
{
return 0;
}

ravi2030
08-21-2001, 10:47 AM
hi,

i am also getting similar errors like in microsoft VC ++:

open1.obj : error LNK2001: unresolved external symbol _gluPerspective@32
open1.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
open1.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
open1.obj : error LNK2001: unresolved external symbol __imp__glViewport@16

help me guys...

thanks

zoldar256
08-21-2001, 11:25 AM
Include the gl library. And if that isn't the case.... Uhhh....

08-21-2001, 11:40 AM
i am the person who posted this message, i have some new information to add when i compile the program witch is a WIn 32 app. i get no error messages but when i execute it in C++ i get the same error message witch is

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

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


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

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

HELP!!!!
thanks

Mezz
08-21-2001, 12:41 PM
Is it a Win32 Application or a Win32 console application?

-Mezz

no-one
08-21-2001, 01:32 PM
so if the errors go away in win32 thats what you need. Win32 apps are c/c++ or whatever language your using...

>but when i execute it in C++ i get the same error message witch is

im not sure whats you mean by this...
are you saying when you compile it as a console?
in that case then that is expected since GL is not made to be used in a console...

Mezz
08-21-2001, 02:42 PM
OpenGL on a Windows platform can run under windows directly or under a DOS shell using GLUT.

If you are not using GLUT and your program has a WinMain() function then you will need to build a Win32 Application in VC++.

If you are using GLUT and your program has a main() function then you should use a Win32 Console Application in VC++.

-Mezz

zed
08-21-2001, 05:29 PM
chuck this somewhere

#pragma comment(linker,"/entry:\"mainCRTStartup\"")