By default when you add an existing file to a AVR Studio 5.0 project, the file is copied locally to the project folder. But ideally developers prefer to link to a file, rather than having multiple copies of it lying around. The following set of steps assumes that you have a project which you would like to add a file to, and the file is not located in a directory that is under the directory storing your .avrsln file.
- Right-click on your project or a folder in your project where you would like your file(s) to be added. Select Add->"Existing Item..."
- Navigate to the location where your file is located. Notice that the "Add" button has a downward-pointing arrow. Click on that arrow and select "Add as Link"
- Any file that is linked will have an arrow over its icon to show that it is a link rather than a file that is present right in that given folder. However, you can still double-click it in the Solution Explorer to edit it, and it will be part of your project.
Q: Ok, good! Why AVR Studio chooses to copy the file(s) by default?
A : AVR Studio 5.0 allows you to do what you want, but you'll get more work done and be able to focus on code if you just let it organize your project for you. I think this is an easy way to go about because trying to get any other layout on the file system would require some extra effort to get it work. I know it can be hard to come from a different convention, and you instinctively want the same conventions in the new environment. However, if you stick with the conventions, (right or wrong in your opinion) you'll get more done because you won't be trying to force the IDE to do things the way you think they should be done. But for people who are developing projects from a library and want to reuse stuff, please excuse, and kindly to an extra click when you add an existing item to your project.
Hope you have a good time with AVR Studio 5.0 J