[Insight-users] Error in program Qt + itk package

Walter Cabrera walter at eresmas.net
Wed Mar 5 06:16:50 EST 2008


Hi Luis,even adding   INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR}) and
INCLUDE_DIRECTORIES(${QT_QT_INCLUDE_DIR}), That this is where
qapplication.h, gives the following errors:

C:\practica\itk\qt\inicio>make
Linking CXX executable QtITK.exe
CMakeFiles/QtITK.dir/QtITK.obj:QtITK.cxx:(.text+0x177): undefined reference
to `_imp___ZN12QApplicationC1ERiPPci'
CMakeFiles/QtITK.dir/QtITK.obj:QtITK.cxx:(.text+0x185): undefined reference
to `_imp___ZN12QApplication4execEv'
CMakeFiles/QtITK.dir/QtITK.obj:QtITK.cxx:(.text+0x1a3): undefined reference
to `QApplication::~QApplication()'
CMakeFiles/QtITK.dir/QtITK.obj:QtITK.cxx:(.text+0x1cc): undefined reference
to 
`QApplication::~QApplication()'
collect2: ld returned 1 exit status
make[2]: *** [QtITK.exe] Error 1
make[1]: *** [CMakeFiles/QtITK.dir/all] Error 2
make: *** [all] Error 2

C:\practica\itk\qt\inicio>




Walter Cabrera wrote:
> 
> I am doing a test with the following source (Qt + itk):
> 
> #include <qapplication.h>
> 
> int main(int argc, char *argv[])
> {
>   QApplication app( argc, argv );
>   return app.exec();
> }
> 
> give  error becouse not found qapplication.h
> 
> CMakeLists.txt used
> 
> PROJECT(QtITK)
> 
> # Find ITK.
> FIND_PACKAGE(ITK REQUIRED)
> IF(ITK_FOUND)
>   INCLUDE(${ITK_USE_FILE})
> ELSE (ITK_FOUND)
>   MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
> 
> # Find Qt.
> FIND_PACKAGE(QT)
> IF(QT_FOUND)
>   INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
> ELSE (QT_FOUND)
>   MESSAGE(FATAL_ERROR "QT not found. Please set QT_DIR.")
> ENDIF(QT_FOUND)
> 
> ADD_EXECUTABLE(QtITK QtITK.cxx)
> 
> Someone can help me?
> 
> Thanks
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-in-program-Qt-%2B-itk-package-tp15714380p15847952.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list