我正在将一个项目从 MSVC2010 交叉编译到 GCC 4.7。我在每个地方调用基类构造函数,如下所示:
FPSCamera::FPSCamera(CameraType camType, float fov, int viewportW, int viewportH, float nearPlane, float farPlane)
{
Camera3D::Camera3D( camType, fov, viewportW, viewportH, nearPlane, farPlane);
}
我进入 GCC :
不能直接调用构造函数
MSVC 不会抱怨……这样就可以修复错误:
FPSCamera::FPSCamera(CameraType camType, float fov, int viewportW, int viewportH, float nearPlane, float farPlane)
:Camera3D( camType, fov, viewportW, viewportH, nearPlane, farPlane);
{
}
为什么?