1
我想創建與OpenGL和CUDA採用C++,但是當我試圖通過函數初始化我收到一個錯誤的場景。 這裏是我的頭:
class SimpleScene
{
public:
SimpleScene();
~SimpleScene();
void computeFPS();
void render();
void display();
void idle();
void keyboard(unsigned char key, int x, int y);
void reshape(int x, int y);
void cleanup();
void initGLBuffers();
uchar *loadRawFile(const char *filename, size_t size);
void initGL(int *argc, char **argv);
int chooseCudaDevice(int argc, char **argv, bool bUseOpenGL);
void runAutoTest(const char *ref_file, char *exec_path);
void loadVolumeData(char *exec_path);
};
在我.cpp文件我有這樣的事情,這generete同樣的錯誤:
void SimpleScene::initGL(int * argc, char ** argv)
{
SimpleScene* obj = new SimpleScene;
// initialize GLUT callback functions
glutInit(argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutInitWindowSize(width, height);
glutCreateWindow("CUDA 3D texture");
glutDisplayFunc(obj->display);
glutKeyboardFunc(obj->keyboard);
glutReshapeFunc(obj->reshape);
glutIdleFunc(obj->idle);
if (!isGLVersionSupported(2, 0) || !areGLExtensionsSupported("GL_ARB_pixel_buffer_object"))
{
fprintf(stderr, "Required OpenGL extensions are missing.");
exit(EXIT_FAILURE);
}
}
的問題是在顯示,閒置,keybord和重塑。報告的錯誤是這樣的:
Error C3867 'SimpleScene::display': non-standard syntax; use '&' to create a pointer to member
Error C3867 'SimpleScene::idle': non-standard syntax; use '&' to create a pointer to member
Error C3867 'SimpleScene::keyboard': non-standard syntax; use '&' to create a pointer to member
Error C3867 'SimpleScene::reshape': non-standard syntax; use '&' to create a pointer to member
HTTPS ://msdn.microsoft.com/en-us/library/b0x1aatf.aspx – rasjani