Xenon 2000 project pcf

A

A.J.B 2.K.3

im trying to work throught the mags(finially) but the first one is giving me
code warrior's compiler is giving me the following errors/warnings,any help
please?


Error : undefined identifier 'DIK_OEM_102'
gs_keycodes.h line 106 gsKEY_OEM_102 = DIK_OEM_102,
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : undefined identifier 'DIK_PAUSE'
gs_keycodes.h line 114 gsKEY_PAUSE = DIK_PAUSE,
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : declaration syntax error
gs_scoretable.h line 23 const int gsSCORE_NAME_SIZE = 3;
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : declaration syntax error
gs_soundsystem.h line 24 class gsCSoundSystem : public gsCObject
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : declaration syntax error
gs_soundsystem.h line 25 {
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : declaration syntax error
gs_soundsystem.h line 26 private:
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : declaration syntax error
gs_soundsystem.h line 33 public:
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Warning : implicit 'int' is no longer supported in C++
gs_soundsystem.h line 34 gsCSoundSystem();
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : illegal function overloading
gs_soundsystem.h line 34 gsCSoundSystem();
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Warning : implicit 'int' is no longer supported in C++
gs_soundsystem.h line 35 gsCSoundSystem();
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : illegal function overloading
gs_soundsystem.h line 35 gsCSoundSystem();
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp

Error : '}' expected
demo1.cpp line 235 }
Project: demo1.mcp, Target: Windows C++ GUI Debug, Source File: demo1.cpp
 
J

John Harrison

A.J.B 2.K.3 said:
im trying to work throught the mags(finially) but the first one is giving me
code warrior's compiler is giving me the following errors/warnings,any help
please?

[error messages snipped]

You are expecting help on error messages without quoting the source code
that is giving rise to the errors. Do you think we are psychic?

john
 
A

A.J.B 2.K.3

all i want to know is what they mean?
im trying to lean c++ but i cant work out what its try to say to me
John Harrison said:
A.J.B 2.K.3 said:
im trying to work throught the mags(finially) but the first one is
giving
me
code warrior's compiler is giving me the following errors/warnings,any help
please?

[error messages snipped]

You are expecting help on error messages without quoting the source code
that is giving rise to the errors. Do you think we are psychic?

john
 
A

A.J.B 2.K.3

John Harrison said:
[error messages snipped]

You are expecting help on error messages without quoting the source code
that is giving rise to the errors. Do you think we are psychic?

john
yo want the 4 for pages of code?
they wont fit here but here goes.

1)
Error : undefined identifier 'DIK_OEM_102'
gs_keycodes.h line 106 gsKEY_OEM_102 = DIK_OEM_102,

code= gsKEY_OEM_102 = DIK_OEM_102,

2)
Error : undefined identifier 'DIK_PAUSE'
gs_keycodes.h line 114 gsKEY_PAUSE = DIK_PAUSE,

code= gsKEY_PAUSE = DIK_PAUSE,
3)
Error : ';' expected
gs_scoretable.h line 23 const Int gsSCORE_NAME_SIZE=3;

code=
//-------------------------------------------------------------

const Int gsSCORE_NAME_SIZE=3;

//-------------------------------------------------------------


4)
Error : undefined identifier 'gsSCORE_NAME_SIZE'
gs_scoretable.h line 30 char m_name[gsSCORE_NAME_SIZE];

code=
//-------------------------------------------------------------

struct gsScoreItem
{
int m_score;
char m_name[gsSCORE_NAME_SIZE];
};

//-------------------------------------------------------------

5)
Error : ';' expected
gs_soundsystem.h line 24 Class gsCSoundSystem : public gsCObject
6)
Error : declaration syntax error
gs_soundsystem.h line 26 private:
7)
Error : declaration syntax error
gs_soundsystem.h line 33 public:
8)
Warning : implicit 'int' is no longer supported in C++
gs_soundsystem.h line 34 gsCSoundSystem()
9)
Error : ';' expected
gs_soundsystem.h line 35 gsCSoundSystem();

code=
//-------------------------------------------------------------

Class gsCSoundSystem : public gsCObject

private:
bool m_active;
gsCList<gsCSample *> m_sample_list;
gsCList<gsCMusic *> m_music_list;

gsCMusic *m_current_music;

public:
gsCSoundSystem()
gsCSoundSystem();

bool create();
bool destroy();

bool isActive();

void clearMusicList();
bool addMusic(const char *filename);
int getNumberOfMusics();
bool playMusic(int index);
void stopMusic();
bool isMusicFinished();

void clearSampleList();
bool addSample(const char *filename);
int getNumberOfSamples();
bool playSample(int index,int panning = 0);
void stopSamples();

void setVolume(int music_percent,int sample_percent);
}

//------------------------------------------------------------

10)
Error : declaration syntax error
gs_sprite.h line 66 inline void gsCSprite::setActive(bool state)
code =

//-------------------------------------------------------------

inline void gsCSprite::setActive(bool state)
{
m_active = state;
}

//-------------------------------------------------------------
11)
Error : '}' expected
demo1.cpp line 235 }

//-------------------------------------------------------------
// Draw all the sprites on screen

void CDemo1::drawSprites()
{
for (int i = 0; i < m_sprite.getSize(); i++)
m_sprite->draw();
}

//-------------------------------------------------------------
// Move all sprites

void CDemo1::moveSprites()
{
gsCRect screen_rect = m_screen.getRect();

// this basically moves each sprite up the screen

// if the sprite goes off the screen it's wrapped
// around to the bottom

for (int i = 0; i < m_sprite.getSize(); i++) {

m_sprite->move(gsCPoint(0,-((i & 3) + 1)));

gsCRect sprite_rect = m_sprite->getRect();

if (!(sprite_rect.overlaps(screen_rect)))
m_sprite->move(gsCPoint(0,m_screen.getSize().getY() +
m_image.getSize().getY()));
}
}
}

//-------------------------------------------------------------
this looks bad cus i have lost the format but the source was givenaway on a
mag
 
J

John Harrison

A.J.B 2.K.3 said:
all i want to know is what they mean?
im trying to lean c++ but i cant work out what its try to say to me

Unforunately compiler error messages often aren't very meaningful.
Especially after the first few errors compilers often get confused and start
reporting evrything as an error. You just have to get used to how you
compiler works.

Error : undefined identifier 'DIK_OEM_102'
gs_keycodes.h line 106 gsKEY_OEM_102 = DIK_OEM_102,

This is very simple, in C++ every name (or identifier) has to be defined
before it is used. The compiler is complaining that you are using the name
DIK_OEM_102 without having defined it first. This is happening in the file
gs_keycodes.h.

Something tells me that isn't a file that you wrote, so why would a file
that someone else wrote be giving you a compilation error. I can't really
answer that. I suspect that you are trying something too ambitious, without
genuinely understanding what you are doing, and just hoping that it will
work.

DIK_PAUSE is the same but the rest are impossible to say without seeing the
code. That means all the code, not just the line that error is on. Post the
code if you want more help, all the code. Sometimes when there is a lot of
code, people place it on a web site and post the link.

john
 
A

A.J.B 2.K.3

thanks ill opst the code page seperatly.
im usind Code warrior but the code was written using bcc and code warrior
doesn't like bcc's grammer.
 
A

A.J.B 2.K.3

//-------------------------------------------------------------
//
// Class: gsCKeyboard - keyboard codes
//
// Author: John M Phillips
//
// Started: 12/03/00
//
// Base: gsCInput
//
// Derived: None
//
//-------------------------------------------------------------

#ifndef _INCLUDE_GS_KEYCODES_H
#define _INCLUDE_GS_KEYCODES_H

//-------------------------------------------------------------
// Key Codes

typedef enum {
gsKEY_NONE = 0,
gsKEY_ESCAPE = DIK_ESCAPE,
gsKEY_1 = DIK_1,
gsKEY_2 = DIK_2,
gsKEY_3 = DIK_3,
gsKEY_4 = DIK_4,
gsKEY_5 = DIK_5,
gsKEY_6 = DIK_6,
gsKEY_7 = DIK_7,
gsKEY_8 = DIK_8,
gsKEY_9 = DIK_9,
gsKEY_0 = DIK_0,
gsKEY_MINUS = DIK_MINUS,
gsKEY_EQUALS = DIK_EQUALS,
gsKEY_BACK = DIK_BACK,
gsKEY_TAB = DIK_TAB,
gsKEY_Q = DIK_Q,
gsKEY_W = DIK_W,
gsKEY_E = DIK_E,
gsKEY_R = DIK_R,
gsKEY_T = DIK_T,
gsKEY_Y = DIK_Y,
gsKEY_U = DIK_U,
gsKEY_I = DIK_I,
gsKEY_O = DIK_O,
gsKEY_P = DIK_P,
gsKEY_LBRACKET = DIK_LBRACKET,
gsKEY_RBRACKET = DIK_RBRACKET,
gsKEY_RETURN = DIK_RETURN,
gsKEY_LCONTROL = DIK_LCONTROL,
gsKEY_A = DIK_A,
gsKEY_S = DIK_S,
gsKEY_D = DIK_D,
gsKEY_F = DIK_F,
gsKEY_G = DIK_G,
gsKEY_H = DIK_H,
gsKEY_J = DIK_J,
gsKEY_K = DIK_K,
gsKEY_L = DIK_L,
gsKEY_SEMICOLON = DIK_SEMICOLON,
gsKEY_APOSTROPHE = DIK_APOSTROPHE,
gsKEY_GRAVE = DIK_GRAVE,
gsKEY_LSHIFT = DIK_LSHIFT,
gsKEY_BACKLASH = DIK_BACKSLASH,
gsKEY_Z = DIK_Z,
gsKEY_X = DIK_X,
gsKEY_C = DIK_C,
gsKEY_V = DIK_V,
gsKEY_B = DIK_B,
gsKEY_N = DIK_N,
gsKEY_M = DIK_M,
gsKEY_COMMA = DIK_COMMA,
gsKEY_PERIOD = DIK_PERIOD,
gsKEY_SLASH = DIK_SLASH,
gsKEY_RSHIFT = DIK_RSHIFT,
gsKEY_MULTIPLY = DIK_MULTIPLY,
gsKEY_ALT = DIK_LMENU,
gsKEY_SPACE = DIK_SPACE,
gsKEY_CAPITAL = DIK_CAPITAL,
gsKEY_F1 = DIK_F1,
gsKEY_F2 = DIK_F2,
gsKEY_F3 = DIK_F3,
gsKEY_F4 = DIK_F4,
gsKEY_F5 = DIK_F5,
gsKEY_F6 = DIK_F6,
gsKEY_F7 = DIK_F7,
gsKEY_F8 = DIK_F8,
gsKEY_F9 = DIK_F9,
gsKEY_F10 = DIK_F10,
gsKEY_NUMLOCK = DIK_NUMLOCK,
gsKEY_SCROLL = DIK_SCROLL,
gsKEY_NUMPAD7 = DIK_NUMPAD7,
gsKEY_NUMPAD8 = DIK_NUMPAD8,
gsKEY_NUMPAD9 = DIK_NUMPAD9,
gsKEY_SUBTRACT = DIK_SUBTRACT,
gsKEY_NUMPAD4 = DIK_NUMPAD4,
gsKEY_NUMPAD5 = DIK_NUMPAD5,
gsKEY_NUMPAD6 = DIK_NUMPAD6,
gsKEY_ADD = DIK_ADD,
gsKEY_NUMPAD1 = DIK_NUMPAD1,
gsKEY_NUMPAD2 = DIK_NUMPAD2,
gsKEY_NUMPAD3 = DIK_NUMPAD3,
gsKEY_NUMPAD0 = DIK_NUMPAD0,
gsKEY_DECIMAL = DIK_DECIMAL,
gsKEY_OEM_102 = DIK_OEM_102,
gsKEY_F11 = DIK_F11,
gsKEY_F12 = DIK_F12,
gsKEY_ENTER = DIK_NUMPADENTER,
gsKEY_RCONTROL = DIK_RCONTROL,
gsKEY_DIVIDE = DIK_DIVIDE,
gsKEY_SYSRQ = DIK_SYSRQ,
gsKEY_RIGHTALT = DIK_RMENU,
gsKEY_PAUSE = DIK_PAUSE,
gsKEY_HOME = DIK_HOME,
gsKEY_UP = DIK_UP,
gsKEY_PAGEUP = DIK_PRIOR,
gsKEY_LEFT = DIK_LEFT,
gsKEY_RIGHT = DIK_RIGHT,
gsKEY_END = DIK_END,
gsKEY_DOWN = DIK_DOWN,
gsKEY_PAGEDOWN = DIK_NEXT,
gsKEY_INSERT = DIK_INSERT,
gsKEY_DELETE = DIK_DELETE,
} gsKeyCode;

//-------------------------------------------------------------

#endif
 
A

A.J.B 2.K.3

Something tells me that isn't a file that you wrote, so why would a file
that someone else wrote be giving you a compilation error. I can't really
answer that. I suspect that you are trying something too ambitious, without
genuinely understanding what you are doing, and just hoping that it will
work.

john
im trying to follow a tut posted in the mag with the source.
 
J

John Harrison

A.J.B 2.K.3 said:
im trying to follow a tut posted in the mag with the source.

Yes but is it a tutorial for your compiler? Different compilers accept
different code and some tutorials don't make it clear which compiler they
are written for.

A good tutorial in the C++ language would be accepted by any compiler but a
bad one wouldn't. My guess is that you are following a graphics tutorial,
and since standard C++ has no graphics at all, every graphics tutorial is
going to be specific to one particular compiler or platform. There is no
guarantee that it will work on another compiler or platform.

You need to learn what is standard C++ and what is not. I would suggest you
find a tutorial in standard C++ before you start to learn other stuff like
graphics.

john
 
J

John Harrison

A.J.B 2.K.3 said:
thanks ill opst the code page seperatly.
im usind Code warrior but the code was written using bcc and code warrior
doesn't like bcc's grammer.

I doubt it's the grammar, it's probably 3rd party libraries which are
supported by one compiler but not the other.

john
 
J

John Harrison

A.J.B 2.K.3 said:
//-------------------------------------------------------------
//
// Class: gsCKeyboard - keyboard codes
//
// Author: John M Phillips
//
// Started: 12/03/00
//
// Base: gsCInput
//
// Derived: None
//
//-------------------------------------------------------------

#ifndef _INCLUDE_GS_KEYCODES_H
#define _INCLUDE_GS_KEYCODES_H

//-------------------------------------------------------------
// Key Codes

typedef enum {
gsKEY_NONE = 0,
gsKEY_ESCAPE = DIK_ESCAPE,
gsKEY_1 = DIK_1,
gsKEY_2 = DIK_2,
gsKEY_3 = DIK_3,
gsKEY_4 = DIK_4,
gsKEY_5 = DIK_5,
gsKEY_6 = DIK_6,
gsKEY_7 = DIK_7,
gsKEY_8 = DIK_8,
gsKEY_9 = DIK_9,
gsKEY_0 = DIK_0,
gsKEY_MINUS = DIK_MINUS,
gsKEY_EQUALS = DIK_EQUALS,
gsKEY_BACK = DIK_BACK,
gsKEY_TAB = DIK_TAB,
gsKEY_Q = DIK_Q,
gsKEY_W = DIK_W,
gsKEY_E = DIK_E,
gsKEY_R = DIK_R,
gsKEY_T = DIK_T,
gsKEY_Y = DIK_Y,
gsKEY_U = DIK_U,
gsKEY_I = DIK_I,
gsKEY_O = DIK_O,
gsKEY_P = DIK_P,
gsKEY_LBRACKET = DIK_LBRACKET,
gsKEY_RBRACKET = DIK_RBRACKET,
gsKEY_RETURN = DIK_RETURN,
gsKEY_LCONTROL = DIK_LCONTROL,
gsKEY_A = DIK_A,
gsKEY_S = DIK_S,
gsKEY_D = DIK_D,
gsKEY_F = DIK_F,
gsKEY_G = DIK_G,
gsKEY_H = DIK_H,
gsKEY_J = DIK_J,
gsKEY_K = DIK_K,
gsKEY_L = DIK_L,
gsKEY_SEMICOLON = DIK_SEMICOLON,
gsKEY_APOSTROPHE = DIK_APOSTROPHE,
gsKEY_GRAVE = DIK_GRAVE,
gsKEY_LSHIFT = DIK_LSHIFT,
gsKEY_BACKLASH = DIK_BACKSLASH,
gsKEY_Z = DIK_Z,
gsKEY_X = DIK_X,
gsKEY_C = DIK_C,
gsKEY_V = DIK_V,
gsKEY_B = DIK_B,
gsKEY_N = DIK_N,
gsKEY_M = DIK_M,
gsKEY_COMMA = DIK_COMMA,
gsKEY_PERIOD = DIK_PERIOD,
gsKEY_SLASH = DIK_SLASH,
gsKEY_RSHIFT = DIK_RSHIFT,
gsKEY_MULTIPLY = DIK_MULTIPLY,
gsKEY_ALT = DIK_LMENU,
gsKEY_SPACE = DIK_SPACE,
gsKEY_CAPITAL = DIK_CAPITAL,
gsKEY_F1 = DIK_F1,
gsKEY_F2 = DIK_F2,
gsKEY_F3 = DIK_F3,
gsKEY_F4 = DIK_F4,
gsKEY_F5 = DIK_F5,
gsKEY_F6 = DIK_F6,
gsKEY_F7 = DIK_F7,
gsKEY_F8 = DIK_F8,
gsKEY_F9 = DIK_F9,
gsKEY_F10 = DIK_F10,
gsKEY_NUMLOCK = DIK_NUMLOCK,
gsKEY_SCROLL = DIK_SCROLL,
gsKEY_NUMPAD7 = DIK_NUMPAD7,
gsKEY_NUMPAD8 = DIK_NUMPAD8,
gsKEY_NUMPAD9 = DIK_NUMPAD9,
gsKEY_SUBTRACT = DIK_SUBTRACT,
gsKEY_NUMPAD4 = DIK_NUMPAD4,
gsKEY_NUMPAD5 = DIK_NUMPAD5,
gsKEY_NUMPAD6 = DIK_NUMPAD6,
gsKEY_ADD = DIK_ADD,
gsKEY_NUMPAD1 = DIK_NUMPAD1,
gsKEY_NUMPAD2 = DIK_NUMPAD2,
gsKEY_NUMPAD3 = DIK_NUMPAD3,
gsKEY_NUMPAD0 = DIK_NUMPAD0,
gsKEY_DECIMAL = DIK_DECIMAL,
gsKEY_OEM_102 = DIK_OEM_102,
gsKEY_F11 = DIK_F11,
gsKEY_F12 = DIK_F12,
gsKEY_ENTER = DIK_NUMPADENTER,
gsKEY_RCONTROL = DIK_RCONTROL,
gsKEY_DIVIDE = DIK_DIVIDE,
gsKEY_SYSRQ = DIK_SYSRQ,
gsKEY_RIGHTALT = DIK_RMENU,
gsKEY_PAUSE = DIK_PAUSE,
gsKEY_HOME = DIK_HOME,
gsKEY_UP = DIK_UP,
gsKEY_PAGEUP = DIK_PRIOR,
gsKEY_LEFT = DIK_LEFT,
gsKEY_RIGHT = DIK_RIGHT,
gsKEY_END = DIK_END,
gsKEY_DOWN = DIK_DOWN,
gsKEY_PAGEDOWN = DIK_NEXT,
gsKEY_INSERT = DIK_INSERT,
gsKEY_DELETE = DIK_DELETE,
} gsKeyCode;

//-------------------------------------------------------------

#endif

Well whoever John M Phillips is he isn't a very good programmer.

You can see a whole load of identifers used in the header file which aren't
defined, DIK_ESCAPE, DIK_1, DIK_2, DIK_3 etc. etc. Also no comments at all
to explain what he thinks he's doing.

If you can't figure out what to do from your tutorial I suggest you go and
find a better one instead. An experienced programmer could figure out this
mess, but its completely unsuitable as a tutorial.

john
 
A

A.J.B 2.K.3

oh well its worth a try thanks
John Harrison said:
Well whoever John M Phillips is he isn't a very good programmer.

You can see a whole load of identifers used in the header file which aren't
defined, DIK_ESCAPE, DIK_1, DIK_2, DIK_3 etc. etc. Also no comments at all
to explain what he thinks he's doing.

If you can't figure out what to do from your tutorial I suggest you go and
find a better one instead. An experienced programmer could figure out this
mess, but its completely unsuitable as a tutorial.

john
 
A

A.J.B 2.K.3

unfortunatly i only have incomplete source from 4 of the 6 mags featuring
the source. why interested in working on it?
 
A

Allan Bruce

A.J.B 2.K.3 said:
unfortunatly i only have incomplete source from 4 of the 6 mags featuring
the source. why interested in working on it?

I would be very interested in working on it - I had a quick look on the web
and found people who claim to have the complete source but nobody has
replied to me yet
Allan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top