有没有 C++某处的依赖索引?

发布于 2024-08-24 11:47:01 字数 419 浏览 3 评论 0原文

当尝试新软件并使用经典的 ./configuremakemake install 过程进行编译时,我经常看到类似以下内容:

error: ____.h: No such file or directory

有时,我得到真的很幸运,apt-get install ____ 安装了缺少的部分,一切都很好。然而,这种情况并不总是发生,我最终通过谷歌搜索找到了包含我需要的东西的包。有时,该软件包的版本或风格错误,并且已被我下载的另一个软件包使用。

人们如何知道哪些包包含哪些 .h 文件或编译器需要的任何资源?是否有依赖解析器网站或人们用来将失败的构建解码为丢失的包的东西?是否有更现代的方法来自动下载和安装构建的传递依赖项(有点像 Java 的 Maven)?

When trying new software and compiling with the classic ./configure, make, make install process, I frequently see something like:

error: ____.h: No such file or directory

Sometimes, I get really lucky and apt-get install ____ installs the missing piece and all is well. However, that doesn't always happen and I end up googling to find the package that contains what I need. And sometimes the package is the wrong version or flavor and is already used by another package that I downloaded.

How do people know which packages contain which .h files or whatever resource the compiler needs? Is there a dependency resolver website or something that people use to decode failed builds to missing packages? Is there a more modern method of automatically downloading and installing transitive dependencies for a build (somewhat like Java's Maven)?

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

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

发布评论

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

评论(3

靑春怀旧 2024-08-31 11:47:01

您还可以使用“auto-apt ./configure”(在 Ubuntu 上,也可能在 Debian 上?),它会尝试自动下载依赖项。

You can also use "auto-apt ./configure" (on Ubuntu, and probably also on Debian?) and it will attempt to download dependencies automatically.

絕版丫頭 2024-08-31 11:47:01

如果是 Debian 中的软件包,您可以使用 apt-get build-dep 来获取所有 deps。

否则,请阅读该程序附带的自述文件——希望它列出了该程序的所有依赖项。

If it's a package in Debian, you can use apt-get build-dep to get all deps.

Otherwise, read the README that comes with the program -- hopefully, it lists all the deps for that program.

遗忘曾经 2024-08-31 11:47:01

所需的包有望在构建包的文档中列出。如果它说您需要 foo,您可能需要查找 foofoo-devel,也许还有 libfoo-devel。如果这没有帮助,在 Fedora 中我会做类似的事情

yum install install /usr/include/_____.h

(yum 将查找包含所述文件的包)。如果以上方法都不起作用,请在 Google 中查找文件名,这应该会告诉您该包来自哪里。但接下来的事情就会变得艰难......

The required packages will hopefully be listed in the documentation for building the package. If it says you require foo, you'll probably want to look for foo and foo-devel, and perhaps libfoo-devel. If that doesn't help, in Fedora I'd do something like

yum install install /usr/include/_____.h

(yum will look for the package containing said file). If none of the above works, look for the file name in Google, that should tell you the package where it comes from. But then the going will get rough...

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