| | |
DECLARATION SYNTAX ERROR (for bc 31 user)
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2004
Posts: 3
Reputation:
Solved Threads: 0
I am novice, and I am working now in a proyect with the vga colour palette, over DOS with borland c 3.1.
The project include cpp.h and asm files. Sintactically I checked that is ok, BUT when I do the link tell me DECLARATION SYNTAX ERROR , in the first clase declared in the first h file in the project, I changed the place of the file but still continue give me the same error.
I send here one of the h files in which you can see that it is ok.
//MOUSE256.H
#ifndef __DOS_H
#include <dos.h>
#endif
#ifndef __STDLIB_H
#include <stdlib.h>
#endif
#ifndef _MOUSE256_H
#define _MOUSE256_H
#endif
//****************************************************************
// Class TMouse
//
// This class defines a group of functions and data structures
// which allow a DOS-based program to set up mouse-operated
// controls. A call-back mechanism allows regions of the
// screen to be defined which trigger calls to user-defined
// functions when the left mouse button is pressed and the
// cursor is within the defined region.
//
//****************************************************************
#define MOUSE_INT 51
#define BUTTON_DOWN 1
#define BUTTON_UP 0
#define BUTTON_LEFT 1
#define BUTTON_RIGHT 2
#define STANDARD_SET 1
#define NO_STANDARD 0
#define BUTTON_ENABLED 1
#define BUTTON_DISABLED 0
#define RUN_ENABLED 0
#define RUN_DISABLED 1
#define MC_RESET 0
#define MC_SHOWCURSOR 1
#define MC_HIDECURSOR 2
#define MC_GETSTATUS 3
#define MC_SETXLIMIT 7
#define MC_SETYLIMIT 8
#define MC_SETMICKEYS 15
class TMouse
{
private:
struct coord_t
{
int current_position;
int down_position;
int up_position;
int limit_min;
int limit_max;
} x,y;
struct button_t
{
int status;
int down_interval;
int up_interval;
} left,right;
struct list_t
{
int x_pos,y_pos;
int x_size,y_size;
int enable_flag;
int(*callback)();
struct list_t *next;
} list_head,*current_call,*list_tail;
union REGS inregs,outregs;
int standard_flag,run_flag,callback_count;
enum {TRUE,PROCESSED,FALSE} press_pending;
public:
TMouse();
~TMouse();
virtual int GetPositionX(void){return(x.current_position);};
virtual int GetPositionY(void){return(y.current_position);};
virtual void HideCursor();
virtual void ShowCursor();
virtual void SetMouseLimits(int,int,int,int);
virtual void SetStandardCallback(int(near*)());
virtual void SetCallback(int(near*)(),int,int,int,int);
virtual void DeleteCallback(int(near*)());
virtual void Run();
private:
void FlagReset();
void GetStatus();
void SetMickeysPerPixel(int,int);
} ;
The project include cpp.h and asm files. Sintactically I checked that is ok, BUT when I do the link tell me DECLARATION SYNTAX ERROR , in the first clase declared in the first h file in the project, I changed the place of the file but still continue give me the same error.
I send here one of the h files in which you can see that it is ok.
//MOUSE256.H
#ifndef __DOS_H
#include <dos.h>
#endif
#ifndef __STDLIB_H
#include <stdlib.h>
#endif
#ifndef _MOUSE256_H
#define _MOUSE256_H
#endif
//****************************************************************
// Class TMouse
//
// This class defines a group of functions and data structures
// which allow a DOS-based program to set up mouse-operated
// controls. A call-back mechanism allows regions of the
// screen to be defined which trigger calls to user-defined
// functions when the left mouse button is pressed and the
// cursor is within the defined region.
//
//****************************************************************
#define MOUSE_INT 51
#define BUTTON_DOWN 1
#define BUTTON_UP 0
#define BUTTON_LEFT 1
#define BUTTON_RIGHT 2
#define STANDARD_SET 1
#define NO_STANDARD 0
#define BUTTON_ENABLED 1
#define BUTTON_DISABLED 0
#define RUN_ENABLED 0
#define RUN_DISABLED 1
#define MC_RESET 0
#define MC_SHOWCURSOR 1
#define MC_HIDECURSOR 2
#define MC_GETSTATUS 3
#define MC_SETXLIMIT 7
#define MC_SETYLIMIT 8
#define MC_SETMICKEYS 15
class TMouse
{
private:
struct coord_t
{
int current_position;
int down_position;
int up_position;
int limit_min;
int limit_max;
} x,y;
struct button_t
{
int status;
int down_interval;
int up_interval;
} left,right;
struct list_t
{
int x_pos,y_pos;
int x_size,y_size;
int enable_flag;
int(*callback)();
struct list_t *next;
} list_head,*current_call,*list_tail;
union REGS inregs,outregs;
int standard_flag,run_flag,callback_count;
enum {TRUE,PROCESSED,FALSE} press_pending;
public:
TMouse();
~TMouse();
virtual int GetPositionX(void){return(x.current_position);};
virtual int GetPositionY(void){return(y.current_position);};
virtual void HideCursor();
virtual void ShowCursor();
virtual void SetMouseLimits(int,int,int,int);
virtual void SetStandardCallback(int(near*)());
virtual void SetCallback(int(near*)(),int,int,int,int);
virtual void DeleteCallback(int(near*)());
virtual void Run();
private:
void FlagReset();
void GetStatus();
void SetMickeysPerPixel(int,int);
} ;
This isn't #included by a C file, is it?
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
I mean, "Is the header file that you have shown above #included by a C file (*.c), or by a C++ file (*.cpp)?" If it is a C file, the class keyword will cause a Declaration syntax error.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Similar Threads
- Class declaration syntax error (C++)
- Homework - error C2059: syntax error : ']' (C++)
- declaration syntax error? (C++)
- Parse error, syntax error, Forbids declaration (C++)
Other Threads in the C++ Forum
- Previous Thread: Delete a .cpp file
- Next Thread: ambigious part 5
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector visualstudio win32 windows winsock word wordfrequency wxwidgets






