Eclipse CDT 中的库顺序

发布于 2024-12-01 01:53:18 字数 560 浏览 0 评论 0原文

我在使用 Eclipse (Indigo) 时遇到关于静态库包含顺序的问题。我在 CDT 中使用托管构建器,并以 gcc 作为编译器。我的工作区有许多静态库项目和几个引用所述库的可执行项目。我使用 Microsoft 的 Team Explorer Everewhere 作为我的源代码管理。

gcc 对于包含库的顺序相当特殊,因此我确保将它们按照我的可执行项目的正确顺序放置(通过转到 Project-->Properties-->C/C++ Build--> ;设置 --> GCC C++ 链接器 --> 库)。但是,如果我修改引用的静态库上的项目设置(哪个设置并不重要),所有使用的可执行项目中的库顺序都会重新排序!如果这样做之后它就起作用了,那么这个黑魔法的东西不一定会打扰我,但 CDT 对库的重新排序完全错误。

我怀疑这与我的可执行项目“引用”库有关,但这是必需的,以便当我更改库时可执行项目会检测到更改并根据需要重新链接。我已经关闭了发现选项、索引和其他一些选项,以查看这些选项是否发生了任何更改。我也用谷歌搜索了解决方案,但没有成功。我即将关闭托管功能并转到 makefile,但这对我来说是最后的手段:)

I am having an issue with Eclipse (Indigo) regarding the order in which my static libraries are being included. I am using the managed builder in CDT with gcc as the compiler. My workspace has many static library projects and a couple executable projects that reference said libraries. I am using Microsoft's Team Explorer Everewhere as my source control.

gcc is rather particular about the order in which libraries are included, so I have made sure to put them in the correct order for my executable projects (by going to Project-->Properties-->C/C++ Build-->Settings-->GCC C++ Linker-->Libraries). However, if I modify a project setting on a referenced static library (it doesn't matter which setting) the library order in all consuming executable projects gets reordered! This black magic stuff wouldn't necessarily bother me if it just worked after doing this, but CDT reorders the libraries completely wrong.

I suspect this is related to my executable projects "referencing" the libraries, but this is something needed so that when I change a library the executable project detects the change and re-links as needed. I have turned off discovery options, indexing, and a few other options to see if those made any changes. I've also googled for a solution but without avail. I am about to just turn off the managed features and go to makefiles, but that is a last resort for me :)

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

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

发布评论

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

评论(1

卸妝后依然美 2024-12-08 01:53:18

根据我的理解,当前工作区中库的所有顺序都源自引用项目的顺序。要更改此设置,请转到项目属性页、c/c++ 常规路径和符号,然后使用“引用”选项卡。更改此设置将更改 cdt 在生成库链接顺序时将使用的顺序。

From my understanding, all the ordering of libraries in the current workspace are derived from the order of referencing projects. To change this, go to the projects property page, c/c++ general, paths and symbols and use the references tab. Changing this will change the order which cdt will use when it generates the order for the libraries to link.

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