Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Visual Studio how to give relative path of a .lib file in project properties

I am building a project using Visual Studio. The project has a dependency on a lib file generated by another project. This project is there is the parent directory of the actual project I am building.

To be more clear, I have a "ParentDir" which has two subDirectories Project1 and Project2 under it. Now Project1 depends on lib generated by Project2.

In the properties of Project1, I am trying to give a relative path using $(SolutionDir)/../ParentDir/Project2/Debug But this does not seem to work.

Can you tell me where i am going wrong, or suggest the correct way of achieving this.

like image 484
AMM Avatar asked Sep 25 '08 11:09

AMM


People also ask

How do I specify a relative file path?

Relative paths make use of two special symbols, a dot (.) and a double-dot (..), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy. A single dot represents the current directory itself.

How do I get the relative path of a file in Visual Studio code?

Relative Path Extension for VS CodePress Ctrl+Shift+H (Mac: Cmd+Shift+H ) and start typing the file you want.

How do I add a reference path in Visual Studio?

If you're using Visual Basic, select the References page, and then click the Reference Paths button. In the Reference Paths dialog box, type the path of the folder that contains the item you want to reference in the Folder field, and then click the Add Folder button. If you're using C#, select the Reference Paths page.

How do you use relative path name?

Because relative path names specify a path starting in the current directory, they do not begin with a slash (/). Relative path names are used to specify the name of a file in the current directory or the path name of a file or directory above or below the level of the current directory in the file system.


1 Answers

Add the dependant project to your solution and set it as a dependency of the other project using project properties. Then it just magically works ;).

A solution is just a file that describes a set of related (interconnected) projects and the relation between them, so this is the correct way of doing it.

like image 102
Terminus Avatar answered Oct 04 '22 02:10

Terminus