opencv 非活动应用程序,当我尝试“imshow()”时出现窗口错误

问题描述 投票:0回答:1

my xcode error image

[错误]
2023-10-29 17:39:35.782532+0900 Surename[4309:273575] [Window] 警告:Window CVWindow 0x108d1c010 从非活动应用程序前面订购,并且可能在活动应用程序的窗口下方订购。
2023-10-29 17:39:35.783451+0900 Surename[4309:273862] [client] 没有 XPC 错误的错误处理程序:连接无效 程序以退出代码结束:0

我在这些环境中使用opencv:M1 Mac(ver.13.4(22F66))、Xcode(版本14.3.1 (14E300c))、C++

我在此例程中安装并构建 opencv。

  • git 克隆opencv 和 opencv_extra_modules
  • brew安装cmake
  • cmake & make & sudo make install

我像这样设置xcode。

  • 标头搜索路径:“.../opencv/install/include/**”
  • 库搜索路径:“.../opencv/install/lib”
  • 其他链接器标志:从终端中的“pkg-config —cflags —libs opencv4”输出。 (安装文件夹有cmake安装东西,因为我有cmake选项。CMAKE_INSTALL_PREFIX=.../opencv/install)

我认为存在一些与动态库链接相关的问题...但我不能确切地确定这一点。

我尝试了xcode设置(RunPath搜索路径:“…/install/lib”和签名&功能-Rumtime异常-禁用库验证检查)。 并将 Environmanet 变量和 PKG_CONFIG_PATH 添加到我的 .zshrc 文件中。

请帮帮我......!!!!我可爱的opencv出了什么问题,,,,,,,,,,,,,

xcode opencv imshow
1个回答
0
投票

通过搜索,我发现这个错误对我来说并不重要。我只想制作简历代码并在 xcode 中检查结果。 因此,就我而言,唯一要做的就是添加这两个代码。 这正确显示了我的结果窗口。

namedWindow("Original Image");
imshow("Original Image", image);
waitKey(0); //add this
destroyAllWindows(); //add this
© www.soinside.com 2019 - 2024. All rights reserved.