One error was that I was using gcc 2.96. Now it s 3.4.1. But I still have lots of error about function and variable not declared. Where should I verify if the includes are right ? (I ve begun with Qt yesterday in fact... I need a user interface with a library using cmake to compile...). My ui.h file has been rename by myself .h because there was an error when compiling. Otherwise, I have a main.cpp file, essai.ui file and essai.ui.h file.<br><br>Olivier<br><br><br>----------------------------------------<br><br>You shouldn't have to modify any files coming out of the Qt Designer.   <br>You may have to make sure that you have the correct includes in either  <br>the ui.h files or that they get added into the widget by the designer.   <br>Note that adding them into the designer gives better dependency  <br>tracking in CMake.<br><br>       Karl<br><br>On Jul 19, 2005, at 6:43 AM, olivier.stern@swing.be wrote:<br><br>> Thanks a lot for all your answers,<br>><br>> This way seems t!
 o be
working and I think now that if it doesn't  <br>> correctly compile it's because I'm using files made by Qt Designer.  <br>> Seems like there're modifications to do, I don't really know what for  <br>> 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}  <br>> ${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  <br>> an<br>> > application using Qt3. I've seen different posts about it a!
 nd after
 <br>> tryi!  ng<br>> > everything I come here to ask some help. Here what is done : a  <br>> simple qt<br>> > application which include 3 files (essai.h essai.ui and main.cpp)  <br>> 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  <br>> 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>> >  <br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/ <br>> libmyqtlib.a(essai.o)(.text+0x<br>> >1<br>> ><br>> > 6): In function `essai::findFile(void)':<br>> > : undefined reference to `QString::null'<br>> ><br>> >  <br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/ <br>> libmyqtlib.a(essai.o)(.text+0x<br>> >1<br>> ><br>> > f): In function `essai::findFile(void)':<br>> > : undefined reference to `QString::null'<br>> ><br>> >  <br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/ <br>> libmyqtlib.a(essai.o)(.text+0x<br>> >2<br>> ><br>> > 4): In function `essai::findFile(void)':<br>> > : undefined reference to `QString::null'<br>> ><br>> >  <br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/ <br>> 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>> ><br>> > QString const &, QWidget *, char const *, QString const &, QString *,<br>> > bool)'<br>> ><br>> >  <br>> /home/olivier/Tfe/GDCM/gdcmBin/bin/Tfe/TEST2/ <br>> 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>> _______________________________________________<br>> CMake mailing list<br>> CMake@cmake.org<br>> http://www.cmake.org/mailman/listinfo/cmake<br>><br><br><br><br>