Qt + VTK +编译器
我正在运行 OSX 10.6 (Snow Leopard)、Qt 4.6、VTK 5.4 和 Cmake 2.8。我安装了 Qt,然后是 VTK 和 Cmake。我将VTK配置为使用QT 4.6(打开VTK_USE_GUISUPPORT和VTK_USE_QVTK)。配置和安装工作顺利,但如果我使用 Qt 引用运行 Cmake,则由于依赖关系解析失败,编译会在后续 make 过程中失败。
例如,我尝试构建 Qt ImageViewer 示例(VTK/Examples/GUI/Qt/ImageViewer),但未能找到 qapplication.h(以及所有其他 qt 标头)。任何关于为什么会发生这种情况的想法将不胜感激!
I'm running OSX 10.6 (Snow Leopard), Qt 4.6, VTK 5.4, and Cmake 2.8. I installed Qt, then VTK and Cmake. I configured VTK to use QT 4.6 (turned on VTK_USE_GUISUPPORT and VTK_USE_QVTK). The configuration and installation worked painlessly but if I run Cmake with Qt references the compilation fails during the subsequent make process because of failed dependency resolution.
As an example, I tried to build the Qt ImageViewer example (VTK/Examples/GUI/Qt/ImageViewer) and it failed to find qapplication.h (and all other qt headers). Any ideas about why this might be happening would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
CMake 通过查找
qmake
来找到 Qt(讽刺,是吗?)。确保qmake
在您的路径中。另外,请确保 VTK 和 Qt 4.6 是使用相同版本的 gcc/g++ 编译的。可能会导致奇怪的运行时错误(例如 cout 不工作)。
CMake finds Qt by looking for
qmake
(ironic, eh?). Make sureqmake
is in your path.Also, make sure VTK and Qt 4.6 were compiled with the same version of gcc/g++. Weird runtime errors (like cout not working) can result.
首先,您应该将
DESIRED_QT_VERSION
设置为 4。准备就绪后,您可以为 qmake 二进制文件选择QT_QMAKE_EXECUTABLE
。First you should set
DESIRED_QT_VERSION
to 4. When it's ready, you could choseQT_QMAKE_EXECUTABLE
to your qmake binary.我发现 cmake 的构建文件夹中的 CMakeCache.txt 往往包含此类内容的所有必要诊断信息。几乎可以肯定,包含路径的字符串字段由于未找到而现在为空。
I find that the CMakeCache.txt in your build folder for cmake tends to have all the necessary diagnostics info for stuff like this. Almost certainly there's a string field for the include path that is blank right now due to not being found.