Archived

This topic is now archived and is closed to further replies.

Error in Visual C++?

This topic is 6584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Are you sure you''re linking in the GL/glide lib files?

Share this post


Link to post
Share on other sites
Yeah, I''m sure. I put glide3x.lib under project/settings/link under object/library modules.

Share this post


Link to post
Share on other sites
Are you sure you''re trying to compile a win32 (not command line) project?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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)


Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Didn''t you have a WinMain function?

I thought so...

You gotta have it you know, when you write win32 programs.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites