Sign in to follow this  
Lemmi

error C4430: missing type specifier

Recommended Posts

Lemmi    126
Hi, I'm working on compiling this HUGE project that came with the 3D Game Programming Book by Stefan Zerbst. I am honestly in over my head because I dont understand 1/10th of it, but I just want to get it compiled to see how it looks, and the only error I'm getting is this: 1>c:\documents and settings\<name>\desktop\zfx3d\chap_15\include\cgameentity.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Yeah, so it's just a header file. I'm going to paste the whole thing. I've marked row 29. // FILE: CGameEntity.h #ifndef CGameEntity_H #define CGameEntity_H #include <windows.h> #include <stdio.h> #include "zfx.h" #include "CGamePortal.h" #include "CGameLevel.h" class CGameLevel; class CGamePortal; class CGameEntity { public: CGameEntity(void); virtual ~CGameEntity(void); virtual HRESULT Render(ZFXRenderDevice*)=0; virtual void Update(float)=0; virtual bool TouchAndUse(const ZFXVector&)=0; virtual bool TestCollision(const ZFXAabb&, ZFXPlane*)=0; virtual bool TestCollision(const ZFXRay&, float, float*)=0; virtual bool Load(FILE*); virtual ZFXAabb GetAabb(void) { return m_Aabb; } 29----> virtual IsOfType(ZFXENTITY e) { return (e==m_Type); } protected: ZFXENTITY m_Type; ZFXAabb m_Aabb; VERTEX *m_pVerts; WORD *m_pIndis; UINT m_NumVerts; UINT m_NumIndis; UINT m_nSkin; }; // class typedef class CGameEntity *LPGAMEENTITY; /*----------------------------------------------------------------*/ class CGameDoor : public CGameEntity { public: CGameDoor(void); virtual ~CGameDoor(void); virtual HRESULT Render(ZFXRenderDevice*); virtual void Update(float); virtual bool Load(FILE*); virtual bool TouchAndUse(const ZFXVector&); virtual bool TestCollision(const ZFXAabb&, ZFXPlane*); virtual bool TestCollision(const ZFXRay&, float, float*); virtual bool IsActive(void) { return m_bActive; } virtual bool ConnectToPortals(CGameLevel*); private: ZFXVector m_vcT; ZFXAXIS m_Axis; float m_fSign; float m_fTime; float m_fDist; float m_fPause; bool m_bActive; bool m_bOpening; bool m_bPausing; UINT m_Portal[2]; CGamePortal* m_pPortal_A; CGamePortal* m_pPortal_B; bool LoadMesh(FILE *pFile); }; // class typedef class CGameDoor *LPGAMEDOOR; /*----------------------------------------------------------------*/ #endif Thanks in advance.

Share this post


Link to post
Share on other sites
Lemmi    126
fixed it, thank you very much! Was fully expecting it to be something complicated. =)

EDIT: I found a new error, this is really baffling me because I can't see what's wrong.


// loop through all objects in list
for (UINT i=0; i<(*pC); i++)
if (ppLob[i] == pLob) break;

// did we find the one we came for?
if (i>=(*pC)) return; <--- Error appears here.

SAFE_DELETE(ppLob[i]);


and I keep on getting "error C2065: 'i' : undeclared identifier"

I tried putting an int i but it doesn't help. Tried about 5 different combinations but it just doesn't want to compile without errors.

[Edited by - Lemmi on March 14, 2010 11:06:13 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this