[CMake] CMake and Qt3

Jens jens-devel at gmx.de
Tue Jul 19 03:54:14 EDT 2005


Hi Olivier
The Qt3-support was broken the last 3 days in CVS. 
Maybe you have to update CMake if you use the latest CVS.
Greetings
	Jens

Am Dienstag, 19. Juli 2005 00:59 schrieb Olivier Stern:
> Hello every one,
>
>
>
> I'm trying to make a CMakeLists.txt file which create a makefile for an
> application using Qt3. I've seen different posts about it and after trying
> everything I come here to ask some help. Here what is done : a simple qt
> application which include 3 files (essai.h essai.ui and main.cpp) and this
> CMakeLists.txt based on the wrapping test :
>
>
>
> SET (QT_WRAP_CPP "On")
>
> SET (QT_MOC_EXE "echo")
>
>
>
> INCLUDE( ${CMAKE_ROOT}/Modules/FindQt.cmake )
>
>
>
> INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
>
> INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
>
>
>
> SET (QT_WRAP_UI "On")
>
> SET (QT_UIC_EXE "${QT_UIC_EXECUTABLE}")
>
>
>
> SET (QTUI_SRCS
>
>   essai.ui
>
>   )
>
> QT_WRAP_UI (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS})
>
> QT_WRAP_CPP (myqtlib QT_MOC_SRCS ${SRCS} essai.h)
>
>
>
> MESSAGE("QT files are ${QTUI_S_SRCS}")
>
> MESSAGE("QT other files are ${QTUI_H_SRCS}")
>
> ADD_DEFINITIONS(${QT_DEFINITIONS})
>
> ADD_LIBRARY(myqtlib ${QTUI_S_SRCS} ${QT_MOC_SRCS})
>
> ADD_EXECUTABLE (qtwrapping main.cpp)
>
> TARGET_LINK_LIBRARIES(qtwrapping myqtlib)
>
> TARGET_LINK_LIBRARIES( qtwrapping ${QT_LIBRARIES} )
>
>
>
> After creating the makefile and compiling the program I have lots of errors
> but all the same type : undefined reference to
>
>
>
> For example the first lines are :
>
> main.o(.text+0x17): In function `main':
> : undefined reference to `QApplication::QApplication(int &, char **)'
>
> main.o(.text+0x80): In function `main':
> : undefined reference to `QApplication::setMainWidget(QWidget *)'
>
> main.o(.text+0xa7): In function `main':
> : undefined reference to `QApplication::exec(void)'
>
> main.o(.text+0xbb): In function `main':
> : undefined reference to `QApplication::~QApplication(void)'
>
> main.o(.text+0xf2): In function `main':
> : undefined reference to `QApplication::~QApplication(void)'
>
> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x
>1
>
> 6): In function `essai::findFile(void)':
> : undefined reference to `QString::null'
>
> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x
>1
>
> f): In function `essai::findFile(void)':
> : undefined reference to `QString::null'
>
> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x
>2
>
> 4): In function `essai::findFile(void)':
> : undefined reference to `QString::null'
>
> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x
>2
>
> a): In function `essai::findFile(void)':
> : undefined reference to `QFileDialog::getOpenFileName(QString const &,
>
> QString const &, QWidget *, char const *, QString const &, QString *,
> bool)'
>
> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x
>b
>
> d): In function `essai::findDir1(void)':
> : undefined reference to `QString::null'
>
> Thank you for your help,
>
>
>
>             Olivier


More information about the CMake mailing list