Error in Visual C++?

Started by
8 comments, last by phantom1 24 years, 3 months ago
I''m new to programming with opengl and glide. I use Visual C++ 5.0 to compile my programs. But for some reason, any time I write an opengl or glide program it gives me a error such as "unresolved external symbol __winmain@16.". Or something like that. Like I said, I''m new and can''t figure out whats causing this. Anyone who has had this problem please let me know how you fixed it.
Chris Hall
Advertisement
Are you sure you''re linking in the GL/glide lib files?
Yeah, I''m sure. I put glide3x.lib under project/settings/link under object/library modules.
Chris Hall
Are you sure you''re trying to compile a win32 (not command line) project?
Yep. Win32 app and linking to glide for sure. I read somewhere ( some other message board I believe ) that you needed to include dinput.h (or something like that) in your app. But tried that and it didn''t work.
Chris Hall
Maybe I misread soemthing or am missing the point, but I get this error:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16

if I misspell or omit the function:
int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
(Which is analogous to the main() of a console app)

Maybe this''ll help, I''m just covering the most obvious base first
-ns

-ns-
I got that message before (since I''m new as well), and I think you need to write a WinMain function (the return type is very long and I don''t remember it off-hand. Try looking for some tutorials around with that function). If you have that function in, the error won''t appear (I think... I''ve tried lots of things and this is one of them. I''m not 100% sure if this is the exact solution or not)


Being a Glide/OpenGL programmer you may have come from a Unix/Linux background so you may need to pick up a little bit of Win32. I am not questioning your abilities so please don''t flame me =)

Best regards,
Sherman

_________________ Best regards, Sherman Chin Director Sherman3D (Malaysia) Sdn Bhd www.Sherman3D.com www.AlphaKimori.com
Didn''t you have a WinMain function?

I thought so...

You gotta have it you know, when you write win32 programs.
I won''t flame ya'' Sherman.
I have the winmain function included. I fixed my problem though so everythings ok. It seems that when I was downloading source code from the net and opening it in VC++,
it was opening it as a console app. Don''t know why but thats what it was doing. Thanks for the help guys.
Chris Hall

This topic is closed to new replies.

Advertisement