Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C++ GLUT with classes?

Options
  • 08-01-2010 8:21pm
    #1
    Closed Accounts Posts: 267 ✭✭


    Hi all,

    I'm making a small game with OpenGL/GLUT and am trying to put my GLUT stuff into classes.

    I'm running into a problem however. I'm trying to access GLUT methods from a class, e.g. glViewPort. I include the header file <GL/glut.h> as normal but every GLUT function can't be resolved by the compiler (i.e. I get 'cannot resolve __imp__glViewPort').

    I came across a suggestion to surround the header with extern 'C' { } but this did not help.

    I am using Eclipse with MinGW (GCC compiler).
    This code was working when it wasn't in classes by the way so the libraries are all linked correctly.

    Any suggestions.


Comments

  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    I created a game, well a scene before with C++/Glut. I created my own set of wrappers in C++. I used visual studio 2005 however.

    Edit: Sorry I noticed you already confirmed correct linking. I'd double check though as it does sound like it not linking with dll. Maybe the MinGW compiler is different.


  • Closed Accounts Posts: 267 ✭✭waitinforatrain


    Got it, apparently all it was is that I forgot to copy over "#define _STDCALL_SUPPORTED" when I moved the stuff

    Cheers for the reply.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Cool nice one. Thanks for the answer too, should help a future googler :)


Advertisement