Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7895205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:35:11+00:00 2026-06-03T07:35:11+00:00

I have a project which needs to be used in 4.6 and 5.0 versions

  • 0

I have a project which needs to be used in 4.6 and 5.0 versions of blackberry.
I have run same code in both the 4.6 and 5.0 versions with some preprocessor directives attached to the code (#ifndef statements which i need to use for 5.0 as facebook sdk is not supported in 4.6 version)
I have 2 .cod files ( one for 4.6 and other for 5.0)
they work as needed in their respective simulators.

But, when i load the .cod file of 4.6 into 5.0 … (it treats it as the code inside preprocessor as comment)
and when i do it viceversa

ie from 5.0 into 4.6 … it says … projectname-1.cod not found .

A similar question is been posted here too check out where a comment on bbtool says it can be possible
One build for two different versions (4.6,4.7 and 5.0+above) in blackberry

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:35:13+00:00Added an answer on June 3, 2026 at 7:35 am

    Using preprocessor is not the way to make A SINGLE BUILD for different BB OS Versions (No matter what tool you use to prepare the build).

    Preprocessors are used just to remove/add particular portion of code based on provided conditions before compiling/building the entire code.
    More generally, preprocessors are used to consider the source code differently for different conditions.
    More more generally, preprocessors are used to produce different source codes for different conditions.
    In such a case the scope of preprocessors is only before compiling/building the code… not after you have build the code and got the executable/.cod/…etc. file

    Read first few lines of T H E S E links; though these are about C-Preprocessors, but the basic is also applicable here.

    Suppose your code is as following:

    // START OF CODE
    //#preprocess
    // this is the second line of the code
    //...
    //#ifdef OS_5
    import net.rim.device.api.ui.component.AutoCompleteField;
    //#else
    //don't import AutoCompleteField and import something else if needed
    //#endif
    
    //...
    //... // some more codes
    //...
    
    //#ifdef OS_5
    //...
    //...
    // Codes for using AutoCompleteField
    //...
    //...
    //#else
    //...
    //...
    // Codes for implementing AutoCompleteField another way by yourself
    //...
    //...
    
    //...
    //... // some more codes
    //...
     // END OF CODE
    

    It doesn’t matter what tool you use to build your code (JDE, Eclipse or using Ant), if you build with the preprocessor 'OS_5' then (if your tool can understand preprocessors) the following code will be generated :

    // START OF CODE
    // this is the second line of the code
    //...
    import net.rim.device.api.ui.component.AutoCompleteField;
    
    //...
    //... // some more codes
    //...
    
    //...
    //...
    // Codes for using AutoCompleteField
    //...
    //...
    
    //...
    //... // some more codes
    //...
     // END OF CODE
    

    and the .cod file will be generated with the above code. And this .cod file will not run on BB OS Versions less than 5.0 because AutoCompleteField is supported from OS 5.

    And if you build without the preprocessor ‘OS_5’ or other preprocessors
    then the following code will be generated:

    // START OF CODE
    // this is the second line of the code
    //...
    //don't import AutoCompleteField and import something else if needed
    
    //...
    //... // some more codes
    //...
    
    
    //...
    //...
    // Codes for implementing AutoCompleteField another way by yourself
    //...
    //...
    
    //...
    //... // some more codes
    //...
     // END OF CODE
    

    and the .cod file will be generated using the above code, and This is going to be a different .cod file than the previous one.

    Now if you want to prepare A SINGLE BUILD and deploy it successfully different BB OS supported devices, then you have to remove dependencies while coding, i.e. use only those API-classes that are supported by all the OS versions (4.6, 5.0… and others if you want). But it’s very difficult sometimes for some cases, because you may have to write your own codes for implementing some features.

    It’s easier to prepare different builds for different OS — and on that purpose you can of course use preprocessors..


    I’m afraid may be I have explained an easy thing in a very complex way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test project in which I needs to load an XLSX file.
I have a project which has some lib's associated with it (in Build Path).
I have some projects built with different versions of VS2005 that require different run-time
I have an xcode workspace which is set up with some project libraries which
I have a project in Eclipse which previously used JRE7 and referenced the JRE7
I have a project in which I need to display multiple UITableView instances inside
I have a GWT project in which I need to manually specify currency, number
I have a project in which I would need to copy files found within
I have a project which fully designed for smart phone and now, I need
I have recently taken on a project in which I need to integrate with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.