Making open GL wrapper library

Hi ,
I have just started making a C++ wrapper for open GL. What I have done is created a class called Triangle, which contains and array of 3 Vertices as private data, and a public render() function. Hence from another program you can create a Triangle and just call render() to draw.
I have compiled this on Linux into a static library without problems. I now try and write a test program (using Qt, but this shouldn’t be relevent) to test it, and I link this to my library. When I run it causes a segmentation fault and exits. Why is this? Is there something special I need to do make a libary and program work together like this. Obviosly there are other libraries which make this work, and it may be a general linking problem rather than and openGL problem, but any ideas?

 Thanks in advance,
      David

Impossible to diagnose without code. Probably has nothing to do with the fact you’re creating a library (but it might). With static libraries, link problems show up at link time, not run time, so I doubt it has anything to do with that.

Here’s a thought: have you tried running your program under a debugger? Like, say, gdb? Can you try and pinpoint where the crash happens and post that code?

We’re going to need a lot more info before anyone can even begin to help you out here.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.