Hello all,
I'm am trying to get this program to work for class tomorrow. Maybe someone would be kind enough to be able to check it out for me. I'm using the g++ compiler in Ubuntu trying to get this openGL application to work. It compiles fine but has a segmentation fault during runtime. I'm using;

g++ -lglut -lGL -lGLU -lGLEW main.cpp -o GSP380Lab3

to compile it.

Recommended Answers

All 5 Replies

Try to cut out code until it is short enough to post here using code tags (< 30 lines). That will help you find the problem, as well as help us fix it if you can't.

Can you give a little more information about the segmentation fault you're getting.

When does it happen? What's happening on screen? What data is given to you with the fault?

I have eliminated all the compile errors but when I try to run the executible, it flashes the window on the screen and then shows segmentation fault on the console window. I posted the code in this post and it can be compiled with the command that I gave in my original post. I don't have any other errors other than that.

Unfortunately I don't have a Unix system here and translating the code to windows may actually remove the error.

There is a program for Unix/Linux called GNU Debugger (GDB)

You should be able to run your app through that. If a crash occurs, you will need to use the -bt (backtrace) command and it will tell you where your sigfault occurs.

EDIT: I've scanned your code and found the error. You've just forgotten to do something with your CGfxClass... =)
(I still suggest downloading GDB as it WILL help you a lot in future)

Thanks for the info. It looks like this application show a little more detail than just running the compiler.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.