错误C1083无法打开包含文件:'vtkGUISupportQtOpenGLModule.h':没有此类文件或目录 [英] Error C1083 Cannot open include file: 'vtkGUISupportQtOpenGLModule.h': No such file or directory

查看:977
本文介绍了错误C1083无法打开包含文件:'vtkGUISupportQtOpenGLModule.h':没有此类文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将VTK库链接到Windows 7上的项目。我得到的错误是:

I'm trying to link VTK library to my project on Windows 7. The error I get is:

错误C1083无法打开包含文件:'vtkGUISupportQtOpenGLModule.h':没有这样的文件或目录

代码中引起错误的是#include< QVTKWidget2.h>

我的VTK副本的构建目录和构建目录是分开的。我使用的链接工具是 cmake 。构建工具: VS 2015

Src and build directories of my VTK copy are separate. The linking tool I use is cmake. The build tool: VS 2015.

我的 CMakeLists.txt 和VTK的缓存u可以在下面看到。

My CMakeLists.txt and VTK's cache u can see below.

在此先感谢您提出任何建议。

Thanks in advance for any suggestions.

CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
set(PROJECT Pro)
project(${PROJECT})

set(BUILD_SHARED_LIBS false)
message("  BUILD_SHARED_LIBS " ${BUILD_SHARED_LIBS})
list(APPEND CMAKE_EXE_LINKER_FLAGS -static)

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

set(VTK_INCLUDE_DIRS
    "D:/libs/VTK-7.1.1"
    )

set(VTK_QT_INCLUDE_DIR
    "D:/libs/VTK-7.1.1/GUISupport/QtOpenGL"
    )

include_directories(${VTK_INCLUDE_DIRS} ${VTK_QT_INCLUDE_DIR})

# ... Local src declaration

add_executable(${PROJECT} ${PRO_APP_HEADERS}${PRO_APP_SOURCES})

if(VTK_LIBRARIES)
  message("VTK_LIBRARIES is set.")
  target_link_libraries(${PROJECT} ${VTK_LIBRARIES})
else(VTK_LIBRARIES)
  message("! VTK_LIBRARIES are not set completely")
  target_link_libraries(${PROJECT} vtkHybrid vtkWidgets)
endif(VTK_LIBRARIES)

VTK的缓存
输入图片

推荐答案

在VTK的CMake中单击高级(在顶部,搜索栏旁边) ),您会看到更多选项。其中之一是Module_vtkGUISupportQtOpenGL,请确保已选中。

Click on "Advanced" in the VTK's CMake (on the top, next to the search bar), you will see many more options. One of them is Module_vtkGUISupportQtOpenGL, make sure it is checked.

在您的CMake中,我认为您的include_directories子句没有任何作用您链接到的路径不是库,而是库的源,库的实际路径将是 D:\VTK_build_directory\include\vtk-7.1。 1\ ,其中VTK_build_directory是您构建VTK的位置(我建议使用 INSTALL 来构建VTK,然后结果将在CMAKE_INSTALL_PREFIX目录中,你可以指定在VTK的CMake中)。但是,无论如何都不需要它,因为您已经在使用 include($ {VTK_USE_FILE}),它将设置所有包含文件。因此,除非您的示例中没有其他用途,否则可以删除整个

In your CMake, I don't think your include_directories clause does anything. The paths you are linking to are not to the library, but rather to the sources of the library, the actual path to the library would be D:\VTK_build_directory\include\vtk-7.1.1\, where VTK_build_directory is wherever you build VTK (I recommend using INSTALL to build VTK, then the result will be in the CMAKE_INSTALL_PREFIX directory, which you can specify in VTK's CMake). However, in any case it is not needed anyway since you are already using the include(${VTK_USE_FILE}), which will setup all include files. So, unless there is some other use not apparent from your example, you can delete the whole

set(VTK_INCLUDE_DIRS
    "D:/libs/VTK-7.1.1"
)

set(VTK_QT_INCLUDE_DIR
    "D:/libs/VTK-7.1.1/GUISupport/QtOpenGL"
)

include_directories(${VTK_INCLUDE_DIRS} ${VTK_QT_INCLUDE_DIR})

这篇关于错误C1083无法打开包含文件:'vtkGUISupportQtOpenGLModule.h':没有此类文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆