Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User nobreak's Avatar
    Join Date
    Aug 2004
    Posts
    20
    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 wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,680
    Preprocessor is standard C/C++, it works in general.
    Could you please show some failing examples?

  3. #3
    Registered User nobreak's Avatar
    Join Date
    Aug 2004
    Posts
    20
    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 nobreak's Avatar
    Join Date
    Aug 2004
    Posts
    20
    anybody here there could help me ?

  5. #5
    Regular Contributor sysctl's Avatar
    Join Date
    Sep 2006
    Location
    Australia, NSW
    Posts
    200
    You can't do it in C preprocessor. As a last resort try making a template and a template specialization.

  6. #6
    Registered User nobreak's Avatar
    Join Date
    Aug 2004
    Posts
    20
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved