Discussion:
Can't figure out these syntax errors
(too old to reply)
Jack
2009-10-05 06:52:31 UTC
Permalink
Error 1 error C2146: syntax error : missing ';' before identifier
'm_d3dEnumeration' d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 51 Project_Sim
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 51 Project_Sim
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 51 Project_Sim
Error 4 error C2146: syntax error : missing ';' before identifier
'm_d3dSettings' d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 52 Project_Sim
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 52 Project_Sim
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 52 Project_Sim
Error 7 error C2061: syntax error : identifier 'VertexProcessingType'
d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 72 Project_Sim
Error 8 error C2146: syntax error : missing ';' before identifier
'm_d3dEnumeration' d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 51 Project_Sim
Error 9 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 51 Project_Sim
Error 10 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 51 Project_Sim
Error 11 error C2146: syntax error : missing ';' before identifier
'm_d3dSettings' d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 52 Project_Sim
Error 12 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 52 Project_Sim
Error 13 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 52 Project_Sim
Error 14 error C2061: syntax error : identifier 'VertexProcessingType'
d:\program files\microsoft directx sdk (october
2006)\samples\c++\d3dapp\include\d3dapp.h 72 Project_Sim

//////////////////////////////////////
I have put the correct path inside properties of the project, also putting
the files in the solution explorer, having also double checked the path in
command prompt, just done whatever I could. But these errors still came up.
What happens?
Thanks
Jack
Jack
2009-10-05 06:55:07 UTC
Permalink
//-----------------------------------------------------------------------------
// File: D3DApp.h
//
// Desc: Application class for the Direct3D samples framework library.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#ifndef D3DAPP_H
#define D3DAPP_H



//-----------------------------------------------------------------------------
// Error codes
//-----------------------------------------------------------------------------
enum APPMSGTYPE { MSG_NONE, MSGERR_APPMUSTEXIT, MSGWARN_SWITCHEDTOREF };

#define D3DAPPERR_NODIRECT3D 0x82000001
#define D3DAPPERR_NOWINDOW 0x82000002
#define D3DAPPERR_NOCOMPATIBLEDEVICES 0x82000003
#define D3DAPPERR_NOWINDOWABLEDEVICES 0x82000004
#define D3DAPPERR_NOHARDWAREDEVICE 0x82000005
#define D3DAPPERR_HALNOTCOMPATIBLE 0x82000006
#define D3DAPPERR_NOWINDOWEDHAL 0x82000007
#define D3DAPPERR_NODESKTOPHAL 0x82000008
#define D3DAPPERR_NOHALTHISMODE 0x82000009
#define D3DAPPERR_NONZEROREFCOUNT 0x8200000a
#define D3DAPPERR_MEDIANOTFOUND 0x8200000b
#define D3DAPPERR_RESETFAILED 0x8200000c
#define D3DAPPERR_NULLREFDEVICE 0x8200000d



//-----------------------------------------------------------------------------
// Name: class CD3DApplication
// Desc: A base class for creating sample D3D9 applications. To create a
simple
// Direct3D application, simply derive this class into a class (such
as
// class CMyD3DApplication) and override the following functions, as
// needed:
// OneTimeSceneInit() - To initialize app data (alloc mem, etc.)
// InitDeviceObjects() - To initialize the 3D scene objects
// FrameMove() - To animate the scene
// Render() - To render the scene
// DeleteDeviceObjects() - To cleanup the 3D scene objects
// FinalCleanup() - To cleanup app data (for exitting the
app)
// MsgProc() - To handle Windows messages
//-----------------------------------------------------------------------------
class CD3DApplication
{
protected:
CD3DEnumeration m_d3dEnumeration;
CD3DSettings m_d3dSettings;


For your reference...
Thanks
Jack
Alex Blekhman
2009-10-05 08:24:20 UTC
Permalink
Post by Jack
class CD3DApplication
{
CD3DEnumeration m_d3dEnumeration;
CD3DSettings m_d3dSettings;
[...]
Apparently, the compiler doesn't recognize CD3DEnumeration and
CD3DSettings as types. It means that you forgot to include
relevant header files before declaration of CD3DApplication class.

Alex
Jack
2009-10-05 08:56:51 UTC
Permalink
Post by Alex Blekhman
Apparently, the compiler doesn't recognize CD3DEnumeration and
CD3DSettings as types. It means that you forgot to include relevant header
files before declaration of CD3DApplication class.
Hi Alex

I roll back my source code, it goes okay now
Thanks for your help
Jack

Jack
2009-10-05 06:58:44 UTC
Permalink
For more references,
CD3DSettings.h and CD3DEnumeration.h are located
in the same folder of D3DApp.h, they have never been touched.
Thanks
Jack
Jack
2009-10-05 07:22:26 UTC
Permalink
Spelt wrong D3DSettings.h D3DEnumation.h
Doesn't affect the status of the question
Thanks
Jack
Jack
2009-10-05 07:03:35 UTC
Permalink
//-----------------------------------------------------------------------------
// File: D3DApp.cpp
//
// Desc: Application class for the Direct3D samples framework library.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#define STRICT
#include <windows.h>
#include <windowsx.h>
#include <mmsystem.h>
#include <stdio.h>
#include <tchar.h>
#include <D3D9.h>
#include "DXUtil.h"
#include "D3DUtil.h"
#include "D3DEnumeration.h"
#include "D3DSettings.h"
#include "D3DApp.h"
#include "D3DRes.h"




//-----------------------------------------------------------------------------
// Global access to the app (needed for the global WndProc())
//-----------------------------------------------------------------------------
static CD3DApplication* g_pD3DApp = NULL;

For more references,
Thanks
Jack
Jack
2009-10-05 08:54:42 UTC
Permalink
That's okay now.
I roll back my source code
Thanks
Jack
Continue reading on narkive:
Loading...