且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Mac OS X 10.6 上的 Qt 4.7 + VTK 5.6.1:链接项目时出错

更新时间:2023-11-10 11:21:16

我不是 VTK 专家,但从您发布的内容来看:

I'm not a VTK guru but from what you posted:

警告

'/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib'未找到以下 -L

'/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found

是不言自明的.所有其他错误看起来都是上述错误的结果.

is self explanatory. All other errors look like consequence of the one above.

你可以尝试做什么:

  1. 检查 VTK 是否编译/安装了 QT 支持.例如你可以尝试编译

  1. Check if VTK was compiled\installed with QT support. For example you can try compiling

/your_vtk_folder/Examples/GUI/Qt/SimpleView/

/your_vtk_folder/Examples/GUI/Qt/SimpleView/

使用 cmake.如果您正确编译并安装了 QT 和 VTK,那么这样做应该不会有任何问题.

using cmake. If you have QT and VTK compiled and installed correctly you shouldn't have any problems doing this.

接下来仔细检查 vtk 包含文件和库的安装位置.在我的机器上文件夹是:

Next double check where vtk include files and libraries were installed. On my machine folders are:

头文件:/usr/local/include/vtk-5.6

headers: /usr/local/include/vtk-5.6

库:/usr/local/lib/vtk-5.6/

libs: /usr/local/lib/vtk-5.6/

在您的 *.pro 文件中,您可以添加以下内容:

In your *.pro file you can add following:

INCLUDEPATH +=/usr/local/include/vtk-5.6

INCLUDEPATH += /usr/local/include/vtk-5.6

LIBS += -L/usr/local/lib/vtk-5.6/-lvtkCommon -lvtksys -lQVTK ...您的项目所需的所有 vtk 库

LIBS += -L/usr/local/lib/vtk-5.6/ -lvtkCommon -lvtksys -lQVTK ... all vtk libs needed for your projects

希望对您有所帮助,问候

hope this helps, regards