调试与发布:将使用两者之一。哪一个是未定义的

发布于 2024-12-19 17:02:31 字数 488 浏览 4 评论 0原文

我有一个问题,已经有一段时间了。

系统设置为 OSX Lion 和 Xcode 4.2.1,MacPorts 安装了 qt4-mac 4.7.4 +debug 和 vtk5 5.6.1。我使用 cmake 作为构建系统。该项目包含一个带有 vtk 小部件的 Qt gui 应用程序。在调试模式下编译 gui 并运行它会抛出很多行,就像

Class QCocoaColorPanelDelegate is implemented in both /opt/local/lib/libQtGui.4.dylib and /opt/local/lib/libQtGui_debug.4.dylib. One of the two will be used. Which one is undefined.

几个 Cocoa 或 NS 相关类一样。

otool -L 告诉我可执行文件已链接到 qt 调试库。

有谁知道导致此问题的原因以及我如何解决它?

I have a problem, quite some time now.

The system settings are OSX Lion with Xcode 4.2.1, MacPorts installed qt4-mac 4.7.4 +debug and and vtk5 5.6.1. I use cmake as build system. The project contains a Qt gui application with a vtk widget. Compiling the gui in debug mode and running it throws a lot of lines like

Class QCocoaColorPanelDelegate is implemented in both /opt/local/lib/libQtGui.4.dylib and /opt/local/lib/libQtGui_debug.4.dylib. One of the two will be used. Which one is undefined.

with several Cocoa or NS related classes.

otool -L tells me the executable is linked against the qt debug libraries.

Has anyone an idea what causes this and how I could resolve it?

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

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

发布评论

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

评论(2

满意归宿 2024-12-26 17:02:31

这对我有用:

sudo port deactivate qt4-mac-devel +debug
sudo port activate qt4-mac-devel @4.8.0_0+quartz

This worked for me:

sudo port deactivate qt4-mac-devel +debug
sudo port activate qt4-mac-devel @4.8.0_0+quartz
剩一世无双 2024-12-26 17:02:31

QCocoaColorPanelDelegate 在两个库中都实现了,但只会加载和使用其中一个实现。您可能应该只链接到一个库或另一个库(我假设您不想链接到调试库)。

QCocoaColorPanelDelegate is implemented in both libraries, but only one of the implementations will be loaded and used. You should probably just link to one library or the other (I'd assume you don't want to link to the debug library).

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