Compile error (#define errors)
Hi,
I have these errors and some one gave me a possible sollution (shown after problem definition in this thread) BUT I am no linux or programming wizz-kid so was wondering if any one who is might be able to help :) 1) This line : #define TRACECAT(category, level, format, args...)\ debug_trace(category, level, _fire_,_line,format,##args) causes these errors: debug.h:35: 'category' was not declared in this scope 35: 'level' was not declared in this scope debug.h:35: 'format' was not declared in this scope debug.h:35: parse error before '#' and 2) This line: #define TRACE(level, format, args...)\ debug_trace(TRACECAT_DEFAULT, level, NULL, -1,format,##args) causes these errors: debug.h:37:ANSI C++ forbids declaration 'debug_trace' with no type debug.h: in function 'int debug_trace(...)' debug.h:37: 'TRACECAT_DEFAULT' undeclared first use in this function. debug.h:37: 'level' was not declared in this scope debug.h:37: 'format' was not declared in this scope debug.h:48:ANSI C++ forbids declaration 'debug_trace' with no type debug.h: in function 'int debug_trace(...)' debug.h:37: 'int debug_trace(...)' previously defined. debug.h:37: parse error before '#' I really do appreciate all your help. looking forward to reply and many thanks in advance. >From: Godfrey Tan <godfreyt@MIT.EDU> >To: Jay Kay <taqlu23@hotmail.com> >Subject: Re: ns-2.1b7a compiling error >Date: Sat, 26 Feb 2005 22:14:18 -0500 > >The following note from a Blueware user might help: >Some compilation notes for blueware under gcc 2.95.3 (suse linux >7.3) > >Blueware will compile with ns-2.1b7a and gcc 2.95.3 but a few tweaks >need to be made. I reckon that this is due to using a >slightly different version of gcc to the blueware team. Note that >blueware does not work with gcc >=3.0 > >For some strange reason in macro definitions the multiline macro of >the style: > >#define macro linel \ >line2 \ >line3 throw compilation errors. Make the macro definitions into one >long line. Whenever you get >an 'unterminated macro call' error, go to that line, and add the >arguement 0 to the function call: e.g > >TRACE_BT(LEVEL_TSF, "_%d_ %s HANDLE: ROOTID %d %s %s bTopoInProg >%d\n"); > >gets changed to: > >TRACE_BT(LEVEL_TSF, "_%d_ %s HANDLE: ROOTID %d %s %s bTopoInProg >%d\n",0); > |
Quote:
figure out a way around the \ - newline character, this is why the compile is burping? You may be looking at some stiff library incompatibilities. nz |
You were right! so you must be a programmer :)
But I now have another problem, it is: Make:*** No rule for target 'Tcl\lib\ns-node.tck' needed by 'gen\ns_tcl.cc'.stop. NS MAKE FAILED. I hate this, every time i fix something something else goes wrong!?! |
Okay another WAG. should 'Tcl\lib\ns-node.tck' be 'Tcl\lib\ns-node.tcl'?
nz |
thx for advice moit. I have fized theons problems posted BUT have tons MORE!
|
All times are GMT -5. The time now is 09:57 PM. |