Discussion Board
-
Preprocessor and carbide.c++
2007-03-20, 17:37
#1
Registered User
Hi,
How is it possibile to use "#if ANYTHING == 1 ..... #endif "
Carbide.c++ 1.1 Express always show the error "illegal token for integral constant expression".
Thank you and Regards
Philipp
-
Re: Preprocessor and carbide.c++
2007-03-20, 19:26
#2
Nokia Developer Moderator
Preprocessor is standard C/C++, it works in general.
Could you please show some failing examples?
-
Re: Preprocessor and carbide.c++
2007-03-22, 10:12
#3
Registered User
Hi, it's wondering me, because over all where I use
#if ANYTHING < ANYTHING
....
#endif
the compiler shows the error message "illegal token for integral constant expression".
here is an example
#if KMAXPROFILECOUNT == 1
msgText.Append(_L("(SP)"));
#endif
Using of
#ifdef KMAXPROFILECOUNT
msgText.Append(_L("(SP)"));
#endif
works.
Maybe I must set any options to the compiler ?
regards
Philipp
-
Re: Preprocessor and carbide.c++
2007-03-26, 10:37
#4
Registered User
anybody here there could help me ?
-
Re: Preprocessor and carbide.c++
2007-03-26, 11:23
#5
Regular Contributor
You can't do it in C preprocessor. As a last resort try making a template and a template specialization.
-
Re: Preprocessor and carbide.c++
2007-03-26, 19:58
#6
Registered User
That's a pity. On Symbian 7 or 8 with CodeWarrior I could do this.
Ok, Thank you and I try to create a template.
Philipp
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