我可以在 Eclipse (CDT) 中的项目之间共享源代码而不使用绝对路径吗?

发布于 2024-09-26 08:51:05 字数 222 浏览 1 评论 0原文

我知道有类似的问题和答案,其中一些在我输入此内容时正在向我提供。然而,他们似乎都没有提供没有绝对路径的解决方案。

我在 SVN 项目中有两个项目,它们需要以共享方式使用一些 .cpp 和 .h 文件。我根本找不到避免绝对路径的方法,绝对路径与我查看代码的目录直接相关。 每个尝试使用代码的人很可能都必须首先修改这些变量。

如果不使用变量(最多),我看不到任何解决方案。我最近缺少什么技巧/进展吗?

I know there are similar questions with answers, and some of them are being offered to my as I type this. However, none of them seem to offer a solution without absolute paths.

I have two projects in an SVN project, and they need use some .cpp and .h files in a shared way. I simply could not find a way of avoiding absolute paths, which are directly related to the directory I check out my code.
It is very likely that everyone trying to use the code will have to modify these variables first.

I could not see any solution without using a variable (at best). Are there any recent tricks/developments I'm missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

破晓 2024-10-03 08:51:05

我想我已经解决了!在 Eclipse CDT 8 中,您可以使用具有工作区绝对或相对路径的链接文件/文件夹。

您需要这样做:

新建文件夹->高级,标记“链接到文件/文件夹到文件系统”,变量->工作空间->扩展,然后选择其他项目文件/文件夹。

最后使用:

每个新链接文件夹的新源文件夹。

就这样!

I think I have solved it!. In Eclipse CDT 8, you can use linked files/folders with absolute or relative paths to Workspace.

You need to do this:

New folder->Advanced, mark "Link to file/folder into filesystem", Variables->Workspace->Extend, then select other project files/folders.

Finally use:

New source folder of each new linked folders.

That's all!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文