Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Making open GL wrapper library

  1. #1
    Guest

    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

  2. #2
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    418

    Re: Making open GL wrapper library

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •