我可以在 Eclipse (CDT) 中的项目之间共享源代码而不使用绝对路径吗?
我知道有类似的问题和答案,其中一些在我输入此内容时正在向我提供。然而,他们似乎都没有提供没有绝对路径的解决方案。
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我已经解决了!在 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!