使用CMAKE C++

发布于 2025-02-13 17:31:01 字数 546 浏览 3 评论 0原文

我正在尝试在Visual Studio 2022中与Dear Imgui一起使用OpenCV。我是C/C ++库的新手,并且一般而言,因此我不确定我是否做对了。 IMGUI使用32位体系结构,我使用CMAKE GUI将源代码编译为Win32。我认为我有编译的源代码,但这似乎与下载预制库不同。 文件Explorer屏幕截图。我已经将垃圾箱添加到路径环境变量中,并且在Visual Studio中尝试添加\ include \ include Directories,\ lib或\ lib \ debug \ debug to Library Directories,以及OpenCV_World460d.lib到其他依赖项中。该程序仍然运行,但似乎并未在#include文件中包含与OpenCV相关的任何内容。我在bin \ debug中找到了一些.dll文件,但是我不确定是否应该为此打扰。我认为我可以将源代码移至项目中,但是我可以肯定的是,这不是做到这一点的正确方法。任何帮助将不胜感激。

I'm trying to use OpenCV with Dear ImGui in Visual Studio 2022. I'm new to C/C++ libraries and building in general, so I'm unsure if I'm doing anything right. ImGui uses 32-bit architecture and I've used Cmake gui to compile the source code as Win32. I think I have the compiled source code, but it seems to be different than downloading the pre-built libraries. File Explorer Screenshot. I've added the bin to PATH environmental variable, and in Visual Studio tried adding \include to Include Directories, \lib or \lib\Debug to Library Directories, and opencv_world460d.lib to Additional Dependencies. The program still runs, but it doesn't seem to include anything related to OpenCV in the #include files. I found a few .dll files in bin\Debug, but I'm not sure if I should bother with that. I think I could move the source code into the project, but I'm fairly certain that isn't the proper way to do it. Any help would be appreciated.

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

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

发布评论

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

评论(1

很快妥协 2025-02-20 17:31:01

我需要运行安装目标:

您可能已经构建了该项目,但是您可能没有运行安装目标。尝试运行cmake -build< build_dir> - config释放,然后cmake-install< build_dir> - config发行,其中< build_dir>是屏幕截图中显示的构建DIR的占位符。后一个命令可能需要管理特权。如果有逐步的构建和amp;安装整个过程。 -
Fabian

I needed to run the install target:

You may have built the project, but probably you didn't run the install target. Try running cmake --build <build_dir> --config Release and then cmake --install <build_dir> --config Release, where <build_dir> is a placeholder for the path to the build dir shown in the screenshot. The latter command probably requires admin privileges. Probably best to check the docs of the lib, if there's a step by step instruction for building & installing the whole thing. –
fabian

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