Ok, I’m still new to OpenGL and I still can’t get my environment set up to compile it properly. I upgraded to vc++ 6.0, got the proper libs and everything from sgi… I still get linker errors that I don’t understand. Check this out:
This looks familiar, but I’m used to working in a unix environment at the college and I’m not sure how to solve this. Any ideas would be appreciated! I guess I just don’t understand why _WinMain would be an unrecognized symbol, since it is not something that I have directly called.
ps if you are on ICQ I can be reached at 3111909 if you’d be willing to help me!
[This message has been edited by AsylumX (edited 05-11-2002).]
When making new project you must set it to Win32 Application and every
windows program must start with WinMain function not main.
Visual C++ comes with headers for OpenGL.
Look for it in MSDN.
Hope this helps.
Thanks but I still don’t quite understand. So instead of int main(…) I should have int WinMain(…)? If I try that, I still get the same error and some warnings, too.
I have the project set up as a win32 application, so that’s taken care of.
hrm…
Am I the only person in the programming world who can’t get OpenGL to compile right? This is very discouraging!
Just a side note, not sure if this matters, but I’m attempting to use glut in my first program here. I have the headers installed in what appear to be the proper directories as well as the libs and dlls, etc.
[This message has been edited by AsylumX (edited 05-12-2002).]
your code expects a console app not a win32 app.
you need to replace void main() with
int WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
not just WinMain()
Well if you are using glut then you can compile an link your program as Win32 Console Application and you can use main function. Just make sure you are linking with
right dlls (glut32.lib, opengl32.lib, glu32.lib) and include glut.h( it includes
gl.h and glu.h files).
There is no need for Win32 API when you use glut.
There are lots of simple examples on net that should compile without problems.
Hope this helps.
My advice is: create a whole new project, and create a console app this time.
There are two types of projects you can create; Win32 Console App, and Win32 App. Win32 App wants a WinMain(), and a Console App want a main(). Look at your code, and create the right project depending on which of these functions are present.