Hi everyone, I am working on a 3D viewer using libQGLViewer. In all of the examples provided, the main function looks something like this:
int main(int argc, char** argv){
QApplication application(argc, argv);
Viewer viewer;
#if QT_VERSION < 0x040000
application.setMainWidget(&viewer);
#else
viewer.setWindowTitle("pointCloud");
#endif
viewer.show();
return(g_qApplication.exec()); //waits for Esc
}
The application and viewer objects need only be referenced in the main loop for all of the examples provided, but for my program, I need to call a function viewer.updateGL() that exists outside the main loop. So I made viewer global. This was not OK, QApplication complained because it needs to be constructed before the Viewer. So I made QApplication application(argc, argv); global with both arguments NULL because I don't use them. QT complained and said it needs real arguments, specifically, the first argument cannot be zero and the second must contain atleast one argument. Problem is, I have no idea how to set a string in a double pointer char (ie. char **argv). I just wasted a lot of time trying to find out and didn't come up with anything. Anyone have any ideas? I basically want this: argv[0] = "./PointCloud", where argv[0][0] to argv[0][12] would contain all the letters and a NULL terminator at the end. There has to be a simple way to do this. Thanks.