Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

C++ GLUT with classes?

  • 08-01-2010 08: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, Registered Users 2 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, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


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


Advertisement