[vtkusers] cmake error: no qvtkwidget.h is found

Yifei Li yifli at mtu.edu
Mon Mar 30 16:18:52 EDT 2009


Brian,

I can build that example without problem. And I did learn a lot from its 
CMakeLists.txt

Now I  want to  write my own CMakeLists.txt from scratch ( trying to get 
rid of those stuff that provides Qt3 compatbility in SimpleView)  and 
have troubles. 
Here is my CMakeLists.txt.  Using 'make verbose=1' did show 
'-I/usr/include/vtk'.

Any help is highly apprecaited.

Yifei

 PROJECT( editor )
 
SET( SAMPLE_SRCS
    main.cpp
    editorwindow.cpp
 )

 SET( SAMPLE_MOC_HDRS
    editorwindow.h
 )

 SET( SAMPLE_UIS
    editor.ui
 )


 FIND_PACKAGE( Qt4 REQUIRED )
 FIND_PACKAGE( VTK )

 INCLUDE( ${QT_USE_FILE} )
 INCLUDE( ${VTK_USE_FILE} )

 QT4_WRAP_UI( SAMPLE_UI_HDRS ${SAMPLE_UIS} )

 QT4_WRAP_CPP( SAMPLE_MOC_SRCS ${SAMPLE_MOC_HDRS} )

 INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ${CMAKE_BINARY_DIR} )

 ADD_EXECUTABLE( editor ${SAMPLE_SRCS} ${SAMPLE_MOC_SRCS} 
${SAMPLE_UI_HDRS} )

 TARGET_LINK_LIBRARIES( editor QVTK ${QT_LIBRARIES} )
Wylie, Brian wrote:
> Yifei,
>
> There's a 'SimpleView' example in VTK\Examples\GUI\Qt\SimpleView that builds a small Qt/VTK application. You might look at it's CMakeLists.txt file for guidance. 
>
> Also, looking through the generated Makefile (or windows project file), may give you some clues. 
>
>   Brian Wylie - Org 1424
>   Sandia National Laboratories
>   MS 1323 - Building CSRI/242
>   (505)844-2238 FAX(505)284-2518   
>        _______ __
>       /_  __(_) /_____ _____
>        / / / / __/ __ `/ __ \
>       / / / / /_/ /_/ / / / /
>      /_/ /_/\__/\__,_/_/ /_/
>             Informatics Toolkit
>
> -----Original Message-----
> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Yifei Li
> Sent: Monday, March 30, 2009 8:30 AM
> To: vtkusers at vtk.org
> Subject: [vtkusers] cmake error: no qvtkwidget.h is found
>
> Hi,
>
> I'm still in the processing of learning cmake. Now I'm tring to compile a very simple Qt/VTK program where a QVTKWidget is the only widget in a QMainWindow. However, after typing make, I got the following errors. (I did install 'vtk-qt-5.0.4-21.fc9.i386' 
> and QVTKWidget.h is in /usr/include/vtk)
>
> In file included from mainwindow/editorwindow.h:2, from mainwindow/main.cpp:1:
> mainwindow/ui_editor.h:23:24: error: qvtkwidget.h: No such file or directory In file included from mainwindow/editorwindow.h:2, from mainwindow/main.cpp:1:
> mainwindow/ui_editor.h:31: error: ISO C++ forbids declaration of 'QVTKWidget' with no type
> mainwindow/ui_editor.h:31: error: expected ';' before '*' token
> mainwindow/ui_editor.h: In member function 'void
> Ui_MainWindow::setupUi(QMainWindow*)':
> mainwindow/ui_editor.h:50: error: 'vtkwidget' was not declared in this scope
> mainwindow/ui_editor.h:50: error: expected type-specifier before 'QVTKWidget'
> mainwindow/ui_editor.h:50: error: expected `;' before 'QVTKWidget'
>
> I attached the CMakeLists.txt and my source code. Could anyone give me some help? Thanks
>
> Yifei
>
>   




More information about the vtkusers mailing list