[英]How to share Library files/ include folders between projects in a single solution on Visual Studio 2022?
I have a VS solution with two separate projects, but I would like to share the external libraries between them.我有一个包含两个独立项目的 VS 解决方案,但我想在它们之间共享外部库。 How would I go about this?
我怎么会go这个呢? Let's say I have two projects in one Solution on Visual Studio Code:
假设我在 Visual Studio Code 的一个解决方案中有两个项目:
Solution Project A Project B解决方案 项目 A 项目 B
I have already included the external libraries on Project A, but I want those libraries to be linked to all my projects within the solution, so I don't have to include them again every time I make a new project.我已经在项目 A 中包含了外部库,但我希望这些库链接到解决方案中的所有项目,这样我就不必在每次创建新项目时都再次包含它们。
I tried including all the libraries on one project but the other project couldn't access the library like I was expecting.我尝试在一个项目中包含所有库,但另一个项目无法像我预期的那样访问该库。 So I had to manually include the libraries for both, bot I want to avoid this to save myself some time.
所以我不得不手动包含两者的库,我想避免这种情况以节省一些时间。
In order for the program to work, it is necessary to manually add the library.为了使程序运行,需要手动添加库。 But in order to reduce repetitive work, you could create a project template after adding the library, and use this template directly when creating a new project without adding the library again.
但是为了减少重复性工作,可以在添加库后创建工程模板,新建工程时直接使用该模板,无需再次添加库。
About how to create a project template you could refer to this document .关于如何创建项目模板可以参考这篇文档。
After the project template is created, you could directly search for it.项目模板创建好后,直接搜索即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.