all groups > visual studio .net debugging > april 2007 >
You're in the

visual studio .net debugging

group:

bool related error


bool related error rseedle
4/19/2007 9:20:02 AM
visual studio .net debugging:
I have some old C code which I am migrating to a new project which has in the
past done a typedef to define bool. Upon migrating to VS2005 I see that bool
is an internal data type. Ok, so I comment out the typedef for the bool. What
I see is that prototypes which use bool now cause an error. For instance:

bool DebugTxDone(void);

Now causes the errors:

c:\fmp1_10_source\debug.h(74) : error C2061: syntax error : identifier
'DebugTxDone'
c:\fmp1_10_source\debug.h(74) : error C2059: syntax error : ';'
c:\fmp1_10_source\debug.h(74) : error C2059: syntax error : 'type'

or using a bool as a parameter type causes the error:

c:\fmp1_10_source\debug.h(76) : error C2146: syntax error : missing ')'
before identifier 'var'
c:\fmp1_10_source\debug.h(76) : error C2081: 'bool' : name in formal
parameter list illegal
c:\fmp1_10_source\debug.h(76) : error C2061: syntax error : identifier 'var'
c:\fmp1_10_source\debug.h(76) : error C2059: syntax error : ';'
c:\fmp1_10_source\debug.h(76) : error C2059: syntax error : ')'

I have tried adding

#include <windows.h>

at the top of the file but still recieve the same results. Do you have any
suggestions ?

Randy


RE: bool related error Andrew McNab
4/19/2007 6:22:01 PM
I haven't used C since 2003 but when I did, I always used <windows.h> for
bool. You could try Bool, Boolean, boolean. If all else fails, at the top of
the header type:

#undef bool
#typedef bool blah blah blah

[quoted text, click to view]
RE: bool related error rseedle
4/20/2007 10:28:01 AM
Actually I found a way around this. It is somehow related to the project
itself not the .c or .h files. That is about as much clearity as I got.

Randy

[quoted text, click to view]
AddThis Social Bookmark Button