Visual Studio 忽略“其他库目录”场地

发布于 2025-01-07 08:08:09 字数 358 浏览 0 评论 0原文

我有几个需要使用的库,但我遇到了一个不寻常的错误,这就是发生的情况。我创建了一个新项目,并一如既往地进入属性>;链接器>输入以添加其他依赖项。然后我进入链接器>;常规并将其位置包含在其他库目录下。

问题是,无论我做什么,Visual Studio 似乎都会忽略附加库目录字段,尽管我在命令行中正确地看到了它。结果我收到无法打开库(LNK1104)错误。

当我将路径放在库旁边并检查拼写错误时,一切正常。我还尝试移动库并提供替代路径,但一切都指向 Visual Studio 只是忽略该字段。更奇怪的是,我还有另一个项目,一切都运行良好。

有谁知道为什么会发生这种情况?

I have several libraries I need to use but I have been confronted by an unusual error, here is what happens. I create a new project and as always I go into properties > Linker > Input to add additional dependencies. I then go into Linker > General and include their location under additional library directories.

The problem is that no matter what I do, Visual Studio appears to be ignoring the additional library directories field, despite me seeing it correctly in the command line. As a result I am getting a cannot open lib (LNK1104) error.

Everything works when I put the path alongside the lib and I checked for spelling mistakes. I also tried moving the libs around and providing alternative paths but everything points to visual studio just ignoring that field. What makes this even more bizarre is that I have another project in which everything works just fine.

Does anyone have any insight on why this might be happening?

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

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

发布评论

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

评论(2

执手闯天涯 2025-01-14 08:08:09

好吧,经过一夜好眠后,我解决了问题。事实证明,我的路径(由 $(SolutionDir) 指定)中有一个逗号。我觉得这是一个比其他任何错误都重要的错误,因为当我在指定库时直接添加它时它起作用了。从通向项目目录的路径中删除逗号解决了问题。 (不,添加引号也不能解决问题)。

Okay so after a good nights sleep I figured out the problem. It turns out that my path, specified by $(SolutionDir), had a comma in it. I feel this is a bug more than anything else because it worked when I added it directly when specifying the lib. Removing the comma from the path leading up to the project directory solved the problem. (And no, adding quotes didn't fix it either).

嘴硬脾气大 2025-01-14 08:08:09

我遇到了这个问题,我尝试了上面的解决方案来包含头文件,重新启动VS,但这并没有解决问题。

我所做的是将解决方案配置选项从调试更改为发布,然后Visual Studio奇迹般地找到了它们。

I had this problem exact problem, I tried the solution above to include header files, restarted VS, however that did not solve the problem.

What I did is changed the Solutions Configuration option from Debug to Release and then Visual Studio miraculously found them.

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