-
Error is thrown on Compilation of C++ Code
Hi All,
A error message is thrown on the compilation of C++ code. The error message is
error: expected initializer before '*' token
Also i am attaching the C++ file here with.
Code:
#ifndef DEBUG
#define DEBUG
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef AGENTDEBUG_PUBLIC
#define AGENTDEBUG_PUBLIC extern
#endif /* AGENTDEBUG_PUBLIC */
AGENTDEBUG_PUBLIC unsigned int gv_nwDebugLevel;
/* ----------------------- Macros Declarations -------------------------*/
#ifdef CMD_ARGS
#define Printf1(msg) printf(msg)
#define Printf2(msg,arg1) printf(msg,arg1)
#define Printf3(msg,arg1,arg2) printf(msg,arg1,arg2)
#define Printf4(msg,arg1,arg2,arg3) printf(msg,arg1,arg2,arg3)
#else
#define Printf1(msg)
#define Printf2(msg,arg1)
#define Printf3(msg,arg1,arg2)
#define Printf4(msg,arg1,arg2,arg3)
#endif
#ifdef DEBUG
/* we are defining debug since it is first level of debug */
#define ERRMSG
#define DEBUGMSG1(msg) { if (gv_nwDebugLevel >= 1) { printtime(); fprintf(OUTPUT,msg); fflush(OUTPUT); } }
#define DEBUGMSG2(msg,arg) { if (gv_nwDebugLevel >= 1) { printtime(); fprintf(OUTPUT,msg,arg); fflush(OUTPUT); } }
#define DEBUGMSG3(msg,arg1,arg2) { if (gv_nwDebugLevel >= 1) { fprintf(OUTPUT,msg,arg1,arg2); fflush(OUTPUT); } }
#define DEBUGMSG4(msg,arg1,arg2,arg3) { if (gv_nwDebugLevel >= 1) { fprintf(OUTPUT,msg,arg1,arg2,arg3);fflush(OUTPUT); } }
#define DEBUGMSG5(msg,arg1,arg2,arg3,arg4) { if (gv_nwDebugLevel >= 1) { fprintf(OUTPUT,msg,arg1,arg2,arg3,arg4);fflush(OUTPUT); } }
#else /* ifndef ERRMSG */
#define DEBUGMSG1(msg)
#define DEBUGMSG2(msg,arg)
#define DEBUGMSG3(msg,arg1,arg2)
#define DEBUGMSG4(msg,arg1,arg2,arg3)
#define DEBUGMSG5(msg,arg1,arg2,arg3,arg4)
#endif /* #ifdef DEBUG */
#ifdef ERRMSG
#define OUTPUT gp_fPtr
#define ERRMSG1(msg) { if (gv_nwDebugLevel >= 0 ) { fprintf(OUTPUT,msg); fflush(OUTPUT); } }
#define ERRMSG2(msg,arg) { if (gv_nwDebugLevel >= 0) { fprintf(OUTPUT,msg,arg); fflush(OUTPUT); } }
#define ERRMSG3(msg,arg1,arg2) { if (gv_nwDebugLevel >= 0) { fprintf(OUTPUT,msg,arg1,arg2); fflush(OUTPUT); } }
#define ERRMSG4(msg,arg1,arg2,arg3) { if (gv_nwDebugLevel >= 0) { fprintf(OUTPUT,msg,arg1,arg2,arg3);fflush(OUTPUT); } }
#else /* ifndef ERRMSG */
#define ERRMSG1(msg)
#define ERRMSG2(msg,arg)
#define ERRMSG3(msg,arg1,arg2)
#define ERRMSG4(msg,arg1,arg2,arg3)
#endif /* #ifdef ERRMSG */
/* ----------------------- Function Prototypes ---------------------------*/
#if defined (ERRMSG)
#define OPENLOGFILE(fName) OpenLogFile(fName)
AGENTDEBUG_PUBLIC FILE *gp_fPtr;
AGENTDEBUG_PUBLIC char OpenLogFile(char *fName);
void printtime();
void printtimemsg(char *msg);
#else
#define OPENLOGFILE(fName)
#endif
#ifdef __cplusplus
}
#endif
/***************************************************************************
* End of agentdebug.h
***************************************************************************/
Kindly help me out in debugging the issue.
Thanks in Advance,
Muthuselvan N
Last edited by jazzezselvan; 04-10-2009 at 06:15 AM.
Reason: updated source code
-
Which line causing the error ?
-
probably a macro mess. You'll need to isolate the line that causes this error.
Danny Kalev
Similar Threads
-
By Noryk Rekrap in forum Talk to the Editors
Replies: 3
Last Post: 08-23-2007, 03:56 PM
-
By Gary Nelson in forum .NET
Replies: 277
Last Post: 10-01-2003, 12:00 AM
-
By Phil Weber in forum .NET
Replies: 632
Last Post: 10-01-2003, 12:00 AM
-
Replies: 150
Last Post: 03-04-2002, 06:40 PM
-
Replies: 90
Last Post: 04-17-2001, 12:45 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|