Ошибка компиляции C ++, конструктор не имеет возвращаемого типа… но я не указал его

Итак, вот это ошибка: 1> c: \ users \ ben \ documents \ visual studio 2010 \ projects \ opengl_learning \ opengl_learning_without_glut \ openglcontext.cpp (18): ошибка C2533: 'OpenGLContext :: {ctor}': конструкторам не разрешен тип возврата

И вот блок кода, в котором указывается ошибка, в частности, ошибка возникает из конструктора по умолчанию:

#include <Windows.h>
#include <iostream>
#include "OpenGLContext.h"


/**
    Default constructor for the OpenGLContext class. At this stage it does nothing 
    but you can put anything you want here. 
*/
OpenGLContext::OpenGLContext(void){}
OpenGLContext::OpenGLContext(HWND hwnd) { 
    createContext(hwnd); 
}
/** 
    Destructor for our OpenGLContext class which will clean up our rendering context 
    and release the device context from the current window. 
*/  

OpenGLContext::~OpenGLContext(void) { 
    wglMakeCurrent(hdc, 0); // Remove the rendering context from our device context
    wglDeleteContext(hrc); // Delete our rendering context 
    ReleaseDC(hwnd, hdc); // Release the device context from our window
}

Почему!?

7
задан acp10bda 18 April 2011 в 11:46
поделиться