Thanks a lot for all your answers,<br><br>This way seems to be working and I think now that if it doesn't correctly compile it's because I'm using files made by Qt Designer. Seems like there're modifications to do, I don't really know what for the moment, but I'll try to correct it.<br><br>Olivier<br><br><br>----------------------------------------<br>FIND_PACKAGE(Qt)<br><br>ADD_DEFINITIONS(${QT_DEFINITIONS})<br>INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR})<br><br>QT_WRAP_CPP(qtwrapping moc_sources essai.h)<br>QT_WRAP_UI(qtwrapping headers sources essai.ui)<br>ADD_EXECUTABLE(qtwrapping main.cpp ${moc_sources} ${headers} ${sources})<br>TARGET_LINK_LIBRARIRES(qtwrapping ${QT_LIBRARIES})<br><br>That should do it<br><br>On Monday 18 July 2005 23:59, Olivier Stern wrote:<br>> Hello every one,<br>><br>><br>><br>> I'm trying to make a CMakeLists.txt file which create a makefile for an<br>> application using Qt3. I've seen different posts about it and after tryi!
 ng<br>>
everything I come here to ask some help. Here what is done : a simple qt<br>> application which include 3 files (essai.h essai.ui and main.cpp) and this<br>> CMakeLists.txt based on the wrapping test :<br>><br>><br>><br>> SET (QT_WRAP_CPP \"On\")<br>><br>> SET (QT_MOC_EXE \"echo\")<br>><br>><br>><br>> INCLUDE( ${CMAKE_ROOT}/Modules/FindQt.cmake )<br>><br>><br>><br>> INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )<br>><br>> INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )<br>><br>><br>><br>> SET (QT_WRAP_UI \"On\")<br>><br>> SET (QT_UIC_EXE \"${QT_UIC_EXECUTABLE}\")<br>><br>><br>><br>> SET (QTUI_SRCS<br>><br>>   essai.ui<br>><br>>   )<br>><br>> QT_WRAP_UI (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS})<br>><br>> QT_WRAP_CPP (myqtlib QT_MOC_SRCS ${SRCS} essai.h)<br>><br>><br>><br>> MESSAGE(\"QT files are ${QTUI_S_SRCS}\")<br>><br>> MESSAGE(\"QT other files are ${QTUI_H_SRCS}\")<br>><br>> ADD_DEFINITIONS(${QT_DEFINITIONS})<br>><br>> ADD_LIBRARY(myqtlib ${QTUI_S_SRCS}
${QT_MOC_SRCS})<br>><br>> ADD_EXECUTABLE (qtwrapping main.cpp)<br>><br>> TARGET_LINK_LIBRARIES(qtwrapping myqtlib)<br>><br>> TARGET_LINK_LIBRARIES( qtwrapping ${QT_LIBRARIES} )<br>><br>><br>><br>> After creating the makefile and compiling the program I have lots of errors<br>> but all the same type : undefined reference to<br>><br>><br>><br>> For example the first lines are :<br>><br>> main.o(.text+0x17): In function `main':<br>> : undefined reference to `QApplication::QApplication(int &, char **)'<br>><br>> main.o(.text+0x80): In function `main':<br>> : undefined reference to `QApplication::setMainWidget(QWidget *)'<br>><br>> main.o(.text+0xa7): In function `main':<br>> : undefined reference to `QApplication::exec(void)'<br>><br>> main.o(.text+0xbb): In function `main':<br>> : undefined reference to `QApplication::~QApplication(void)'<br>><br>> main.o(.text+0xf2): In function `main':<br>> : undefined reference to `QApplication::~QApplication(void)'<br>><br>>
/home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x<br>>1<br>><br>> 6): In function `essai::findFile(void)':<br>> : undefined reference to `QString::null'<br>><br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x<br>>1<br>><br>> f): In function `essai::findFile(void)':<br>> : undefined reference to `QString::null'<br>><br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x<br>>2<br>><br>> 4): In function `essai::findFile(void)':<br>> : undefined reference to `QString::null'<br>><br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x<br>>2<br>><br>> a): In function `essai::findFile(void)':<br>> : undefined reference to `QFileDialog::getOpenFileName(QString const &,<br>><br>> QString const &, QWidget *, char const *, QString const &, QString *,<br>> bool)'<br>><br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/libmyqtlib.a(essai.o)(.text+0x<br>>b<br>><br>> d): In function
`essai::findDir1(void)':<br>> : undefined reference to `QString::null'<br>><br>> Thank you for your help,<br>><br>><br>><br>>             Olivier<br><br>-- <br>Filipe Sousa<br><br><br>