Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / January 2004



Tip: Looking for answers? Try searching our database.

"bool" is declaration syntax error?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Duncan - 16 Jan 2004 19:23 GMT
Pardon my newness, I'm back with CodeWarrior after ten years. It's
good to be back... at least, I think it will be.

I'm porting a C++ library from (ahem) Visual C++ to CW on OS X. I
created a project from the Library template /Applications/.../Mac OS
C++/Mac OS Carbon/Library. Trying to compile one of the simpler source
files individually (baby steps first) comes up short immediately. A
bool member variable in a class declaration is illegal, with the
keyword "bool" underlined.

The declaration is in an included header (.h) but the base file is
.cpp, so you'd think the compiler would treat the compilation unit as
a C++ file. I set the "Force C++ compilation" flag just in case, but
no change. Suggestions welcome.

Andrew
aduncan@expertcity.com
Sean McBride - 16 Jan 2004 20:04 GMT
> The declaration is in an included header (.h) but the base file is
> .cpp, so you'd think the compiler would treat the compilation unit as
> a C++ file. I set the "Force C++ compilation" flag just in case, but
> no change. Suggestions welcome.

Right near that flag there is another one for bool support, is it on?
MW Ron - 16 Jan 2004 22:11 GMT
>Pardon my newness, I'm back with CodeWarrior after ten years. It's
>good to be back... at least, I think it will be.
[quoted text clipped - 5 lines]
>bool member variable in a class declaration is illegal, with the
>keyword "bool" underlined.

There are two things that come to mind.  First is you don't have bool
enabled (as Sean said) and the other is that maybe one of the headers
has disabled bool.  Visual C++ didn't support it on older versions and
it may be written in a way that if it doesn't have VC++ v xxxx it
disables bool.  

If enable bool is selected then preprocess the source file and search
for bool from the top and see if there is a reason for it to be disabled.

Ron

>The declaration is in an included header (.h) but the base file is
>.cpp, so you'd think the compiler would treat the compilation unit as
[quoted text clipped - 3 lines]
>Andrew
>aduncan@expertcity.com

Signature

Metrowerks, maker of CodeWarrior   -  "Software Starts Here"  
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>

Andrew Duncan - 19 Jan 2004 20:14 GMT
> There are two things that come to mind.  First is you don't have bool
> enabled (as Sean said)

That was it. How did I miss that? Well let me confirm that it *is*
good to be back, and
I see that the legendary MW support is still up to snuff. Which is why
I spec-ed
MW in preference to Xcode (which I do use anyway -- two compilers
good, one
compiler bad) sight unseen. Thanks!

Andrew
Thorrsten Froehlich - 16 Jan 2004 23:24 GMT
> I'm porting a C++ library from (ahem) Visual C++ to CW on OS X. I
> created a project from the Library template /Applications/.../Mac OS
> C++/Mac OS Carbon/Library. Trying to compile one of the simpler source
> files individually (baby steps first) comes up short immediately. A
> bool member variable in a class declaration is illegal, with the
> keyword "bool" underlined.
<snip>
> a C++ file. I set the "Force C++ compilation" flag just in case, but
> no change. Suggestions welcome.

Did you check "Enable bool support"?

   Thorsten
Lally Singh - 16 Jan 2004 23:52 GMT
> Pardon my newness, I'm back with CodeWarrior after ten years. It's
> good to be back... at least, I think it will be.
[quoted text clipped - 10 lines]
> a C++ file. I set the "Force C++ compilation" flag just in case, but
> no change. Suggestions welcome.

Is "Bool Support" on?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.