This is a question about using Visual Studio 2003. Sorry it is not strictly a programming question but it does affect my work in a rather annoying way.
I have a solution with 3 different projects (let's say MyProgram, UnitTest and PerformanceTest), and there is a file (let's say myclass.h) which needs to be shared between the 3 projects.
The file is created in the MyProgram project and now I want to add it to the others.
Say I go to the solution explorer, right click on UnitTest, and select Add -> Add Existing Item from the pop-up menu.
The file myclass.h was added to the project, but instead of pointing to the existing (solution directory)\MyProgram\myclass.h, a new file is created in (solution directory)\UnitTest\myclass.h. Now this means that everytime I change \MyProgram\myclass.h, I need to copy it to \UnitTest\myclass.h or the file is not up to date.
Is this a "feature" of Visual Studio 2003 or have I got something wrong with the options/settings? Is manually editing the .vcproj files the only way to make the links point to an existing file? Thank you very much for your help.
Best Solution
Try this - To create a link to an existing item:
1.In Solution Explorer, select the target project. 2.On the Project menu, select Add Existing Item. 3.In the Add Existing Item dialog box, locate and select the project item you want to link. 4.From the Open button drop-down list, select Add As Link.
http://msdn.microsoft.com/en-us/library/9f4t9t92.aspx
Your right - that is 2008. This link implies what you want to do was introduced in VS 2005 and is not available in 2003:
http://blogs.msdn.com/jjameson/archive/2009/04/02/linked-files-in-visual-studio-solutions.aspx