×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    20

    Preprocessor and carbide.c++

    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

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: Preprocessor and carbide.c++

    Preprocessor is standard C/C++, it works in general.
    Could you please show some failing examples?

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    20

    Re: Preprocessor and carbide.c++

    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

  4. #4
    Registered User
    Join Date
    Aug 2004
    Posts
    20

    Re: Preprocessor and carbide.c++

    anybody here there could help me ?

  5. #5
    Regular Contributor
    Join Date
    Sep 2006
    Location
    Australia, NSW
    Posts
    200

    Re: Preprocessor and carbide.c++

    You can't do it in C preprocessor. As a last resort try making a template and a template specialization.

  6. #6
    Registered User
    Join Date
    Aug 2004
    Posts
    20

    Re: Preprocessor and carbide.c++

    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
  •  
×