none
Project Reference in Visual C++ RRS feed

  • Question

  • I am trying to add project references to a visual c++ project but the path information is stored as a full path and not a relative path.  Multiple developers are using this solution so if one person sets the path information for his local machine then the other person, who has the solution stored in a different path, tries to open the solution he will find that there are Missing project references.

    I have other solutions in VS that use visual c# and the project references in those solutions are all relative path references.

    Is there a way to set up a project reference so that the path is a relative path in Visual c++?  I know that I can set up a .dll reference that is a relative path reference.  However, I want to do a project reference so that the source will be loaded with the solution file. 

    Thanks,
    -Zack
    Monday, June 8, 2009 4:42 PM

Answers

  • Hello zstewart,

    To avoid the project references missing used by team members and to retain the settings even if somebody copy the source code to another machine you can follow the following steps/suggestions:
    1. Open the project's Property Pages dialog box.
    2. Click the C/C++ folder.
      NOTE: In Visual C++ 2005, expand Configuration Properties, and then expand C/C++.
    3. Click the General property page.
    4. Modify the Resolve #using References property to point to the folder that contains the target assembly.
    5. Click on the edit box , one window Resolve #using References  appears.
    6. In the window Resolve #using References you can hard code the path.
    7. Do not allow people to change the folder heirarachy and directory of the source code I mean source code should be on the same path for each resources in the team to avoid the missing of references.

    regards
    Shiv S.Kushwaha


    Shiv S.Kushwaha
    • Marked as answer by Nancy Shao Monday, June 15, 2009 2:38 AM
    Wednesday, June 10, 2009 7:30 AM

All replies

  • Project references are to assemblies, not to source. I wonder if you're talking about multi-project solutions instead.

    Using solutions created in VS 2008, I only see relative paths in the .sln files -- and I don't see any place where different behavior could be specified. You could try hand-editing the .sln file in a text editor, to use paths which are relative to the .sln file. Then try opening the solution again in VS 2008 (or whichever IDE version it might be).

    If this response misses the mark, please describe how you're adding project references. Thanks.

    Wednesday, June 10, 2009 12:01 AM
  • For this type of situations you must create a directory structure that every project member must follow.
    In this case, relative path is the way to go.

    You should also consider using a source code control system like VSS or SVN.

    «_Superman_»
    Wednesday, June 10, 2009 2:37 AM
  • Hello zstewart,

    To avoid the project references missing used by team members and to retain the settings even if somebody copy the source code to another machine you can follow the following steps/suggestions:
    1. Open the project's Property Pages dialog box.
    2. Click the C/C++ folder.
      NOTE: In Visual C++ 2005, expand Configuration Properties, and then expand C/C++.
    3. Click the General property page.
    4. Modify the Resolve #using References property to point to the folder that contains the target assembly.
    5. Click on the edit box , one window Resolve #using References  appears.
    6. In the window Resolve #using References you can hard code the path.
    7. Do not allow people to change the folder heirarachy and directory of the source code I mean source code should be on the same path for each resources in the team to avoid the missing of references.

    regards
    Shiv S.Kushwaha


    Shiv S.Kushwaha
    • Marked as answer by Nancy Shao Monday, June 15, 2009 2:38 AM
    Wednesday, June 10, 2009 7:30 AM