Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

How do you share files in an Eclipse projects?

I'm starting a second project based on my first NIOS II project. All but 3 of the source files are the same. I want to create a Common_Source folder for the common files and share this with 2 or more projects. I know I can create a library, but these files depend on system.h which prevents this from working. I want to build these with each project's settings.

Short of putting C files in the project with# include "../Common_Source/filename.c", is there a better way?

Thank you!

Bill A.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    solution:

    For each project that needs the shared folder of files:

    1. Open properties for the project.

    2. Select c/c++ project paths.

    3. Click add folder...

    4. Click create new folder...

    5. Click advanced >>

    6. Check link to folder in the file system

    7. Click browse... or enter the folder name

    8. Click ok

    9. Click ok

    10. Click ok

    All of the files in this folder (and sub folders) will be compiled into the project as if they were located in the project's base folder.