#### Archived

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

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

## Recommended Posts

Lately I've been getting some errors with linking. I can't for the life of me figure out why. It always involves whenever I use #include windows.h #include gl\gl.h #include conio.h #include gl\glaux.h void main(void) { //my code here } I get a linking error LNK2001:unresolved external symbol _WinMain@16 then a fatal error LNK1120: unresolved external symbols. whenever I've programmed using OpenGL before I haven't had this problem. Any ideas. Mat Edited by - doodah2001 on January 14, 2001 7:45:56 PM

##### Share on other sites
Win32 apps require a WinMain() function, instead of the normal main() function.

==================
/* todo: insert cool sig */
Martee
Magnum Games.NET

##### Share on other sites
I''m now getting a compiler error. It''s telling me the WinMain() function is overloaded, which it''s not.

##### Share on other sites
Have you declared the WinMain function correctly?
It should look something like this:

  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char * szCmdLine, int iShowCmd){ // you code here...}

Look at the examples at MSDN

##### Share on other sites
I got it fixed now. My brain just wasn''t working like it''s supposed too.