• Advertisement
Sign in to follow this  

[.net] C++.net, OpenGL & windows.forms

This topic is 4821 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

Hi All, I'm currently coding a small app using windows forms and opengl in c++, the problem I'm having is when compliling I get an error - C:\OGLSDK\include\gl\gl.h(1155): error C2086: 'int APIENTRY' : redefinition C:\OGLSDK\include\gl\gl.h(1151) : see declaration of 'APIENTRY' - it stops at 100 errors! I'm new to the .net ide, is there a setting, #pragma or something I'm missing? Using VS.net pro 2002 on xp pro, ogl release 2. As I couldn't find any examples (found plenty of posts asking for one though!), I'll post it when done. Thanks.Micko

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Micko
Hi All,
I'm currently coding a small app using windows forms and opengl in c++, the problem I'm having is when compliling I get an error -

C:\OGLSDK\include\gl\gl.h(1155): error C2086: 'int APIENTRY' : redefinition
C:\OGLSDK\include\gl\gl.h(1151) : see declaration of 'APIENTRY'

- it stops at 100 errors!

I'm new to the .net ide, is there a setting, #pragma or something I'm missing?
Using VS.net pro 2002 on xp pro, ogl release 2.
As I couldn't find any examples (found plenty of posts asking for one though!), I'll post it when done.
Thanks.Micko

The Microsoft implementation of OpenGL uses types defined in windows.h, so you have to include it before including gl.h. Did you try adding "#include <windows.h>" to your headers?

HTH,

Share this post


Link to post
Share on other sites
Doh!
Thanks kSquared, it's always something simple! (I included the gl.h before windows)
I will post the sample later today.
Thanks.Micko

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement