×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    69

    How to share common files from folder in multiple projects

    Hello,

    I have 3 projects which have some common files. These common files are in one folder. Where can I set the path to include these files when I 'make' the project?

    I am using CodeWarrior.


    Please advice.
    Tejaswini

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to share common files from folder in multiple projects

    In the .mmp, you can add a new USERINCLUDE line, and a new SOURCEPATH-SOURCE block.
    For example:
    Code:
    ...
    
    SOURCEPATH ..\src
    SOURCE a.cpp
    SOURCE b.cpp
    
    SOURCEPATH ..\..\common\src
    SOURCE common1.cpp
    
    USERINCLUDE ..\inc
    USERINCLUCE ..\..\common\inc
    
    ...

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

    Re: How to share common files from folder in multiple projects

    Is there a good (and by "good" I mean built-in, not hacktastic) way of managing Carbide.c++ projects so they can reference each other, auto-update exported headers and libs and be moved together (ala Visual Studio's "solution")?

  4. #4
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    81

    Re: How to share common files from folder in multiple projects

    I'm doing this using linked folders in Carbide.c++ but they are hard links to directories on the disk, so if you move (rename) the base folders all the links get broken :-(

  5. #5
    Nokia Developer Moderator
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    4,492

    Re: How to share common files from folder in multiple projects

    Quote Originally Posted by sysctl
    Is there a good (and by "good" I mean built-in, not hacktastic) way of managing Carbide.c++ projects so they can reference each other, auto-update exported headers and libs and be moved together (ala Visual Studio's "solution")?
    Suggestion of Wizard_hu can be implemented in Carbide.c++ too since the 'update symbian mmp file' facility is made available in the version 1.1.

    (and by "good" I mean built-in, not hacktastic)
    Am not sure if you might call it 'good' or 'hacktastic'

    cheers
    Neil

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

    Re: How to share common files from folder in multiple projects

    Sorry I missed your post. And this won't work for me as I use Carbide itself for build (and it completely ignores the MMP file).

  7. #7
    Nokia Developer Moderator
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    4,492

    Re: How to share common files from folder in multiple projects

    Quote Originally Posted by sysctl
    Sorry I missed your post. And this won't work for me as I use Carbide itself for build (and it completely ignores the MMP file).
    Carbide.c++ express v 1.1 is what I was refering to

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

    Re: How to share common files from folder in multiple projects

    Quote Originally Posted by Symbian_Neil
    Carbide.c++ express v 1.1 is what I was refering to
    Yes, but it doesn't use MMP file to build the project, and you suggest updating MMP file. Updating MMP would have no effect on build process.

  9. #9
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: How to share common files from folder in multiple projects

    Do we have a working solution to this issue..?

    Cheers
    mayank

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

    Re: How to share common files from folder in multiple projects

    You can share header files by placing a relative directory entry in user include path in Carbide project properties (e.g. if you had something like ${ProjDirPath}\inc, you also add extra ${ProjDirPath}\..\proj2\inc). Which is still a rather bad solution (you need to do it for every build configuration), but a working one. No solution for sharing CPP files in Carbide 1.1. Either build from command line, or subscribe to Carbide 1.2 Beta, it supports MMP files.

  11. #11
    Registered User
    Join Date
    Apr 2007
    Posts
    3

    Re: How to share common files from folder in multiple projects

    Hi everybody!
    Sharing CPP/C between multiple projects in Carbide 1.1 is possible.
    Here's my solution:
    Let's say we have 2 projects c:\workspace\proj1 and c:\workspace\proj2.
    We have some cpp and h files we want to share between these projects, let's sey we put them in "c:\workspace\shared\inc" and "c:\workspace\shared\src".
    To share all files from these 2 folders we have to make links to them.
    To do this edit .project file and add following xml sections

    HTML Code:
    <linkedResources>
    [...]
    <link>
     <name>shared_inc</name>
     <type>2</type>
    <location>c:/workspace/shared/inc</location>
    </link>
    <link>
     <name>shared_src</name>
     <type>2</type>
    <location>c:/workspace/shared/src</location>
    </link>
    [...]
    </linkedResources>
    [...]
    (shared_inc and shared_src are any names you like)
    Now you should see the folders in your project. To notify carbide that the folders are source folders edit .cdtproject file adding following lines:
    HTML Code:
    <item id="org.eclipse.cdt.core.pathentry"> 
    [...]
    <pathentry kind="src" path="shared_inc"/>
    <pathentry kind="src" path="shared_src"/>
    [...]
    </item>
    The last thing is adding User Include Paths to shared_inc folder. You can do this from Carbide Properties: c/c++ Build -> System Options ->User Include Paths -> Add -> "c:\workspace\shared\inc".

    That's all. Now you can successfully compile your project with shared files

    Cheers
    Tums
    Last edited by tums; 2007-04-12 at 10:26.

  12. #12
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: How to share common files from folder in multiple projects

    That is one way and the other way is :-

    File->New->File->Advanced>> Check "Link to file in the file system" and create the link, so the file gets included as an external link and for the .h follow the steps as tums mentions and you are done..:-)

    Cheers
    mayank

  13. #13
    Registered User
    Join Date
    Feb 2007
    Posts
    6

    Re: How to share common files from folder in multiple projects

    This is looking promising!
    Will this work for any file/folder location, or must the files be located in the workspace, or in another Carbide project ?

    BR
    Björn

  14. #14
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: How to share common files from folder in multiple projects

    It could be anywhere..for instance I link files like this which is platform independent..and doesnt really belong to any carbide project/workspace at all.

    Cheers
    mayank

    P.S. I wanted to know though ..just like Windows Mobile can we specify the output directory as well with Carbide..for instance can i specify where the lib files should be placed..where the exe and stuff like that..for instance right now the lib files go to epoc32/release/armv5/urel by default for GCCE and winscw/udeb for Emulator builds?

  15. #15
    Registered User
    Join Date
    Feb 2007
    Posts
    6

    Re: How to share common files from folder in multiple projects

    Thank you so much for this information, I am sorry I cannot help you with your output problem. I can however report that
    1. The &lt;link&gt; method worked in Carbide.c++ Express 1.0 also
    2. However, only complete absolute paths seemed to work, not paths relative to the .project file location
    3. And sadly, the project built ok, but couldn't be opened properly in the C/C++ Project Explorer in Carbide.c++. Clicking the '+' sign for the project accomplished nothing.

    But I guess two steps forward and only one back counts as progress! :-)

    Thanks again, Cheers!
    /Björn
    Last edited by scalado-bjorna; 2007-04-16 at 13:06.

Similar Threads

  1. How to play multiple .wav files?
    By BenNg in forum Symbian
    Replies: 20
    Last Post: 2010-02-22, 15:17
  2. Replies: 0
    Last Post: 2003-09-26, 05:10
  3. Sending several files without using SIS
    By stopin in forum Symbian
    Replies: 0
    Last Post: 2003-07-10, 16:32
  4. Replies: 0
    Last Post: 2002-09-27, 06:55
  5. Creating new files in a different folder
    By ACATTAN in forum Symbian User Interface
    Replies: 0
    Last Post: 2002-06-10, 10:04

Posting Permissions

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