×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    10

    Using different libraries for different SDKs

    Hi,

    I have a project for S60 3rd FP1 and want to extend it to also build a version for FP2. I have no problems keeping the code portable using "#ifdef", but I can't tell Carbide to use different library-configurations for different SDKs.
    My first idea was to use a second mmp-file and modify the bld.inf to point to the mmp using "#if defined()", but I could not get this to work.
    I searched a lot but didn't find the right information in the documentation.

    Has anybody a hint about how to do this or where to look for the right informations?

    Thanks,

    Jojo

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Using different libraries for different SDKs

    Hi,

    There are lots of comman things in both the SDK except few, so if there is any any apI that you want to use in fp2 make #deine would be the right thing to do.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Using different libraries for different SDKs

    The .mmp file also gets feeded to the preprocessor, so you can use #ifdef-s and the like in it. However for having defined something in an SDK-specific way, you have to put your definitions to the SDK-s, so you could try to find out where the preprocessor checks for the #include-d files with <> or "".
    For getting some ideas I have searched for mmp preprocessor in the SDK Help, and found "Symbian OS v9.x » Symbian OS Tools And Utilities » Build tools guide » Build-time variants", which seems to be the official way, you can try if it works.

  4. #4
    Registered User
    Join Date
    Mar 2009
    Posts
    10

    [solved]Re: Using different libraries for different SDKs

    Quote Originally Posted by wizard_hu_ View Post
    The .mmp file also gets feeded to the preprocessor, so you can use #ifdef-s and the like in it.
    Yes, that's exactly what I need. I only found a hint that the bld.inf is preprocessed, but nothing about the mmp.

    Quote Originally Posted by wizard_hu_ View Post
    However for having defined something in an SDK-specific way, you have to put your definitions to the SDK-s, so you could try to find out where the preprocessor checks for the #include-d files with <> or "".
    For getting some ideas I have searched for mmp preprocessor in the SDK Help, and found "Symbian OS v9.x » Symbian OS Tools And Utilities » Build tools guide » Build-time variants", which seems to be the official way, you can try if it works.
    Thanks for your effort! I'm using the already existing defines for the SDKs, e.g. the "__S60_32__" for the FP2. Works fine for now, nevertheless I'll have a look at your hints when I've a little bit more time.

    Thanks a lot,

    Jojo

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: [solved]Re: Using different libraries for different SDKs

    Quote Originally Posted by p3jojo View Post
    Thanks for your effort! I'm using the already existing defines for the SDKs, e.g. the "__S60_32__" for the FP2. Works fine for now
    That is even better, I just did not know if those symbols are available already in "mmp time".

  6. #6
    Registered User
    Join Date
    Mar 2009
    Posts
    10

    Re: [solved]Re: Using different libraries for different SDKs

    Quote Originally Posted by wizard_hu_ View Post
    That is even better, I just did not know if those symbols are available already in "mmp time".
    In fact I'm not sure anymore, whether they are! I was convinced that this is a working solution, as the libraries that are shown in the Libraries-Tab of the mmp-editor changed when I switched the active SDK. So far so good, but building failed with linker errors

    So it was a bit early adding a "solved" to the headline

    Finally I did it the following way (found somewhere in your hints):
    Create a SDK_VERSION.mmp foreach SDK, located in the include-dir of the SDK.
    For the FP2, mine just contains:
    MACRO __S60_3RD_FP2__
    #define __S60_3RD_FP2__

    Now I just include this file in my normal mmp-file and using #ifdef works as expected.

    Regards,

    Jojo

  7. #7
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: [solved]Re: Using different libraries for different SDKs

    Quote Originally Posted by p3jojo View Post
    Finally I did it the following way (found somewhere in your hints):
    Create a SDK_VERSION.mmp foreach SDK, located in the include-dir of the SDK.
    For the FP2, mine just contains:
    MACRO __S60_3RD_FP2__
    #define __S60_3RD_FP2__

    Now I just include this file in my normal mmp-file and using #ifdef works as expected.

    Regards,

    Jojo
    If you have separate .mmp for for each SDK, then no need to declare "#define __S60_3RD_FP2__" in .mmp file. #define declared in .mmp will work(valid) inside .mmp only. Just declare MACRO __S60_3RD_FP2__ in .mmp and use this macro in all .cpp and .h files.

  8. #8
    Registered User
    Join Date
    Mar 2009
    Posts
    10

    Re: [solved]Re: Using different libraries for different SDKs

    Quote Originally Posted by savaj View Post
    If you have separate .mmp for for each SDK, then no need to declare "#define __S60_3RD_FP2__" in .mmp file. #define declared in .mmp will work(valid) inside .mmp only. Just declare MACRO __S60_3RD_FP2__ in .mmp and use this macro in all .cpp and .h files.
    I'm aware about that. I had no problems in the .h and .cpp files, I only had problems within the mmp-file, as I had to use different libs. There might be a way to have several mmp-files in one project and choose one automatically depending on the used SDK, but I could not get it to work.


    Regards,

    Jojo

  9. #9
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Using different libraries for different SDKs

    What we did was do diff's again the hrh file in the include\<variant.hrh> file since this is used by the preprocessor and this will show which macros are defined in each platform and which ones are not. then you can use these as #ifdef's in the mmp file.

    Its a lot easier and does not require additional files or other hacks.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

Similar Threads

  1. WSD in Static libraries..
    By mayankkedia in forum Symbian
    Replies: 4
    Last Post: 2007-04-13, 10:07
  2. sms libraries
    By andy_watson00 in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2007-03-05, 09:20
  3. How to solve this Carbide.c++ link static libraries issue
    By kathyxu123 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 0
    Last Post: 2006-10-20, 19:23
  4. Carbide.vs problem with the installed SDK's
    By njonesy in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2005-11-28, 10:40
  5. 3510i, 7210 SDKs language support problem
    By dzaga in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2003-06-17, 16:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×