Results 1 to 8 of 8

Thread: qmake: does no generate .h file from .ui file

  1. #1
    Join Date
    Apr 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default qmake: does no generate .h file from .ui file

    //QT4
    //System: Ubuntu 10.10, x32


    Hi,
    I try run the example application (http://sector.ynet.sk/qt4-tutorial/t...rst_qt_app.zip)

    I have a files:
    main.cpp
    myqtapp.cpp
    myqtapp.h
    myqtapp.ui

    So i try generate a project: qmake -project
    In project folder was generate a file sym.pro with content:
    ################################################## ####################
    # Automatically generated by qmake (1.07a) Mon Apr 18 11:08:30 2011
    ################################################## ####################

    TEMPLATE = app
    INCLUDEPATH += .

    # Input
    INTERFACES += myqtapp.ui
    SOURCES += main.cpp
    btw. i also try write this file manualy

    Next i try: qmake
    Makefile was generated by i don't have a ui_myqtapp.h! Why?
    Of course when I try: make, i get errors caused missing ui_myqtapp.h.

    I'd by very grateful if someone tell me what is wrong.


    This is my Makefile:
    Qt Code:
    1. #############################################################################
    2. # Makefile for building: sym
    3. # Generated by qmake (1.07a) (Qt 3.3.8b) on: Mon Apr 18 11:13:01 2011
    4. # Project: sym.pro
    5. # Template: app
    6. # Command: $(QMAKE) -o Makefile sym.pro
    7. #############################################################################
    8.  
    9. ####### Compiler, tools and options
    10.  
    11. CC = gcc
    12. CXX = g++
    13. LEX = flex
    14. YACC = yacc
    15. CFLAGS = -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT
    16. CXXFLAGS = -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT
    17. LEXFLAGS =
    18. YACCFLAGS= -d
    19. INCPATH = -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3
    20. LINK = g++
    21. LFLAGS =
    22. LIBS = $(SUBLIBS) -L/usr/share/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm -lpthread
    23. AR = ar cqs
    24. RANLIB =
    25. MOC = /usr/share/qt3/bin/moc
    26. UIC = /usr/share/qt3/bin/uic
    27. QMAKE = qmake
    28. TAR = tar -cf
    29. GZIP = gzip -9f
    30. COPY = cp -f
    31. COPY_FILE= $(COPY)
    32. COPY_DIR = $(COPY) -r
    33. INSTALL_FILE= $(COPY_FILE)
    34. INSTALL_DIR = $(COPY_DIR)
    35. DEL_FILE = rm -f
    36. SYMLINK = ln -sf
    37. DEL_DIR = rmdir
    38. MOVE = mv -f
    39. CHK_DIR_EXISTS= test -d
    40. MKDIR = mkdir -p
    41.  
    42. ####### Output directory
    43.  
    44. OBJECTS_DIR = ./
    45.  
    46. ####### Files
    47.  
    48. HEADERS =
    49. SOURCES = main.cpp
    50. OBJECTS = main.o \
    51. myqtapp.o
    52. FORMS = myqtapp.ui
    53. UICDECLS = myqtapp.h
    54. UICIMPLS = myqtapp.cpp
    55. SRCMOC = moc_myqtapp.cpp
    56. OBJMOC = moc_myqtapp.o
    57. DIST = sym.pro
    58. QMAKE_TARGET = sym
    59. DESTDIR =
    60. TARGET = sym
    61.  
    62. first: all
    63. ####### Implicit rules
    64.  
    65. .SUFFIXES: .c .o .cpp .cc .cxx .C
    66.  
    67. .cpp.o:
    68. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    69.  
    70. .cc.o:
    71. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    72.  
    73. .cxx.o:
    74. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    75.  
    76. .C.o:
    77. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    78.  
    79. .c.o:
    80. $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
    81.  
    82. ####### Build rules
    83.  
    84. all: Makefile $(TARGET)
    85.  
    86. $(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
    87. $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS)
    88.  
    89. mocables: $(SRCMOC)
    90. uicables: $(UICDECLS) $(UICIMPLS)
    91.  
    92. $(MOC):
    93. ( cd $(QTDIR)/src/moc && $(MAKE) )
    94.  
    95. Makefile: sym.pro /usr/share/qt3/mkspecs/default/qmake.conf /usr/share/qt3/lib/libqt-mt.prl
    96. $(QMAKE) -o Makefile sym.pro
    97. qmake:
    98. @$(QMAKE) -o Makefile sym.pro
    99.  
    100. dist:
    101. @mkdir -p .tmp/sym && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/sym/ && ( cd `dirname .tmp/sym` && $(TAR) sym.tar sym && $(GZIP) sym.tar ) && $(MOVE) `dirname .tmp/sym`/sym.tar.gz . && $(DEL_FILE) -r .tmp/sym
    102.  
    103. mocclean:
    104. -$(DEL_FILE) $(OBJMOC)
    105. -$(DEL_FILE) $(SRCMOC)
    106.  
    107. uiclean:
    108. -$(DEL_FILE) $(UICIMPLS) $(UICDECLS)
    109.  
    110. yaccclean:
    111. lexclean:
    112. clean: mocclean uiclean
    113. -$(DEL_FILE) $(OBJECTS)
    114. -$(DEL_FILE) *~ core *.core
    115.  
    116.  
    117. ####### Sub-libraries
    118.  
    119. distclean: clean
    120. -$(DEL_FILE) $(TARGET) $(TARGET)
    121.  
    122.  
    123. FORCE:
    124.  
    125. ####### Compile
    126.  
    127. main.o: main.cpp myqtapp.h
    128.  
    129. myqtapp.h: myqtapp.ui
    130. $(UIC) myqtapp.ui -o myqtapp.h
    131.  
    132. myqtapp.cpp: myqtapp.h myqtapp.ui
    133. $(UIC) myqtapp.ui -i myqtapp.h -o myqtapp.cpp
    134.  
    135. myqtapp.o: myqtapp.cpp myqtapp.h
    136.  
    137. moc_myqtapp.o: moc_myqtapp.cpp myqtapp.h
    138.  
    139. moc_myqtapp.cpp: $(MOC) myqtapp.h
    140. $(MOC) myqtapp.h -o moc_myqtapp.cpp
    141.  
    142. ####### Install
    143.  
    144. install:
    145.  
    146. uninstall:
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qmake: does no generate .h file from .ui file

    Try to update your qmake, because it looks like you have old version.
    To fix this by hand, I think you need to change INTERFACES += to FORMS += in .pro file.

  3. #3
    Join Date
    Apr 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake: does no generate .h file from .ui file

    To fix this by hand, I think you need to change INTERFACES += to FORMS += in .pro file.
    I try this way many time but i have any diffrents if I use FORM or INTERFACES

    Try to update your qmake, because it looks like you have old version.
    I have before qt4-make 4.6.2. Now I install qt4-make 4.7.0 by i still have this problem

  4. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qmake: does no generate .h file from .ui file

    qt4-make 4.6.2. Now I install qt4-make 4.7.0
    What is the output of qmake -version ? Should be something like:
    QMake version 2.01a
    Using Qt version 4.7.2 in /usr/local/Trolltech/Qt-4.7.2/lib
    try
    sudo apt-get update
    sudo apt-get install qt4-qmake
    or build qt from sources ( qt-everywhere-opensource-src-4.7.2 )

  5. #5
    Join Date
    Apr 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake: does no generate .h file from .ui file

    What is the output of qmake -version ? Should be something like:
    Qmake version: 1.07a (Qt 3.3.8b)
    Qmake is free software from Trolltech ASA.
    Qt 3.3.8B?? WTF


    Added after 8 minutes:


    Now i have:

    QMake version 2.01a
    Using Qt version 4.6.2 in /usr/lib
    qmake -project generate a file:

    ################################################## ####################
    # Automatically generated by qmake (2.01a) pon. kwi 18 11:57:38 2011
    ################################################## ####################

    TEMPLATE = app
    TARGET =
    DEPENDPATH += .
    INCLUDEPATH += .

    # Input
    HEADERS += myqtapp.h
    FORMS += myqtapp.ui
    SOURCES += main.cpp myqtapp.cpp
    But qmake still don't generate a header file
    Last edited by miodas007; 18th April 2011 at 10:59.

  6. #6
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qmake: does no generate .h file from .ui file

    But qmake still don't generate a header file
    Correct, qmake won't generate any headers, it's make that generates ui_*.h files.
    Try to make clean build (make clean, qmake, make), if it does not help, show the Makefile generated by this version of qmake.

  7. #7
    Join Date
    Apr 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake: does no generate .h file from .ui file

    unfortunately i reply now, becouse before i was busy.

    Try to make clean build (make clean, qmake, make), if it does not help, show the Makefile generated by this version of qmake.
    make clean given nothing, so i pase content of my Makefile:
    Qt Code:
    1. #############################################################################
    2. # Makefile for building: sym
    3. # Generated by qmake (2.01a) (Qt 4.6.2) on: pon. kwi 18 22:11:07 2011
    4. # Project: sym.pro
    5. # Template: app
    6. # Command: /usr/bin/qmake -unix -o Makefile sym.pro
    7. #############################################################################
    8.  
    9. ####### Compiler, tools and options
    10.  
    11. CC = gcc
    12. CXX = g++
    13. DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
    14. CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    15. CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    16. INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I.
    17. LINK = g++
    18. LFLAGS = -Wl,-O1
    19. LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread
    20. AR = ar cqs
    21. RANLIB =
    22. QMAKE = /usr/bin/qmake
    23. TAR = tar -cf
    24. COMPRESS = gzip -9f
    25. COPY = cp -f
    26. SED = sed
    27. COPY_FILE = $(COPY)
    28. COPY_DIR = $(COPY) -r
    29. STRIP = strip
    30. INSTALL_FILE = install -m 644 -p
    31. INSTALL_DIR = $(COPY_DIR)
    32. INSTALL_PROGRAM = install -m 755 -p
    33. DEL_FILE = rm -f
    34. SYMLINK = ln -f -s
    35. DEL_DIR = rmdir
    36. MOVE = mv -f
    37. CHK_DIR_EXISTS= test -d
    38. MKDIR = mkdir -p
    39.  
    40. ####### Output directory
    41.  
    42. OBJECTS_DIR = ./
    43.  
    44. ####### Files
    45.  
    46. SOURCES = main.cpp \
    47. myqtapp.cpp moc_myqtapp.cpp
    48. OBJECTS = main.o \
    49. myqtapp.o \
    50. moc_myqtapp.o
    51. DIST = /usr/share/qt4/mkspecs/common/g++.conf \
    52. /usr/share/qt4/mkspecs/common/unix.conf \
    53. /usr/share/qt4/mkspecs/common/linux.conf \
    54. /usr/share/qt4/mkspecs/qconfig.pri \
    55. /usr/share/qt4/mkspecs/features/qt_functions.prf \
    56. /usr/share/qt4/mkspecs/features/qt_config.prf \
    57. /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
    58. /usr/share/qt4/mkspecs/features/default_pre.prf \
    59. /usr/share/qt4/mkspecs/features/release.prf \
    60. /usr/share/qt4/mkspecs/features/default_post.prf \
    61. /usr/share/qt4/mkspecs/features/warn_on.prf \
    62. /usr/share/qt4/mkspecs/features/qt.prf \
    63. /usr/share/qt4/mkspecs/features/unix/thread.prf \
    64. /usr/share/qt4/mkspecs/features/moc.prf \
    65. /usr/share/qt4/mkspecs/features/resources.prf \
    66. /usr/share/qt4/mkspecs/features/uic.prf \
    67. /usr/share/qt4/mkspecs/features/yacc.prf \
    68. /usr/share/qt4/mkspecs/features/lex.prf \
    69. /usr/share/qt4/mkspecs/features/include_source_dir.prf \
    70. sym.pro
    71. QMAKE_TARGET = sym
    72. DESTDIR =
    73. TARGET = sym
    74.  
    75. first: all
    76. ####### Implicit rules
    77.  
    78. .SUFFIXES: .o .c .cpp .cc .cxx .C
    79.  
    80. .cpp.o:
    81. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
    82.  
    83. .cc.o:
    84. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
    85.  
    86. .cxx.o:
    87. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
    88.  
    89. .C.o:
    90. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
    91.  
    92. .c.o:
    93. $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
    94.  
    95. ####### Build rules
    96.  
    97. all: Makefile $(TARGET)
    98.  
    99. $(TARGET): ui_myqtapp.h $(OBJECTS)
    100. $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
    101.  
    102. Makefile: sym.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \
    103. /usr/share/qt4/mkspecs/common/unix.conf \
    104. /usr/share/qt4/mkspecs/common/linux.conf \
    105. /usr/share/qt4/mkspecs/qconfig.pri \
    106. /usr/share/qt4/mkspecs/features/qt_functions.prf \
    107. /usr/share/qt4/mkspecs/features/qt_config.prf \
    108. /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
    109. /usr/share/qt4/mkspecs/features/default_pre.prf \
    110. /usr/share/qt4/mkspecs/features/release.prf \
    111. /usr/share/qt4/mkspecs/features/default_post.prf \
    112. /usr/share/qt4/mkspecs/features/warn_on.prf \
    113. /usr/share/qt4/mkspecs/features/qt.prf \
    114. /usr/share/qt4/mkspecs/features/unix/thread.prf \
    115. /usr/share/qt4/mkspecs/features/moc.prf \
    116. /usr/share/qt4/mkspecs/features/resources.prf \
    117. /usr/share/qt4/mkspecs/features/uic.prf \
    118. /usr/share/qt4/mkspecs/features/yacc.prf \
    119. /usr/share/qt4/mkspecs/features/lex.prf \
    120. /usr/share/qt4/mkspecs/features/include_source_dir.prf
    121. $(QMAKE) -unix -o Makefile sym.pro
    122. /usr/share/qt4/mkspecs/common/g++.conf:
    123. /usr/share/qt4/mkspecs/common/unix.conf:
    124. /usr/share/qt4/mkspecs/common/linux.conf:
    125. /usr/share/qt4/mkspecs/qconfig.pri:
    126. /usr/share/qt4/mkspecs/features/qt_functions.prf:
    127. /usr/share/qt4/mkspecs/features/qt_config.prf:
    128. /usr/share/qt4/mkspecs/features/exclusive_builds.prf:
    129. /usr/share/qt4/mkspecs/features/default_pre.prf:
    130. /usr/share/qt4/mkspecs/features/release.prf:
    131. /usr/share/qt4/mkspecs/features/default_post.prf:
    132. /usr/share/qt4/mkspecs/features/warn_on.prf:
    133. /usr/share/qt4/mkspecs/features/qt.prf:
    134. /usr/share/qt4/mkspecs/features/unix/thread.prf:
    135. /usr/share/qt4/mkspecs/features/moc.prf:
    136. /usr/share/qt4/mkspecs/features/resources.prf:
    137. /usr/share/qt4/mkspecs/features/uic.prf:
    138. /usr/share/qt4/mkspecs/features/yacc.prf:
    139. /usr/share/qt4/mkspecs/features/lex.prf:
    140. /usr/share/qt4/mkspecs/features/include_source_dir.prf:
    141. qmake: FORCE
    142. @$(QMAKE) -unix -o Makefile sym.pro
    143.  
    144. dist:
    145. @$(CHK_DIR_EXISTS) .tmp/sym1.0.0 || $(MKDIR) .tmp/sym1.0.0
    146. $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/sym1.0.0/ && $(COPY_FILE) --parents myqtapp.h .tmp/sym1.0.0/ && $(COPY_FILE) --parents main.cpp myqtapp.cpp .tmp/sym1.0.0/ && $(COPY_FILE) --parents myqtapp.ui .tmp/sym1.0.0/ && (cd `dirname .tmp/sym1.0.0` && $(TAR) sym1.0.0.tar sym1.0.0 && $(COMPRESS) sym1.0.0.tar) && $(MOVE) `dirname .tmp/sym1.0.0`/sym1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/sym1.0.0
    147.  
    148.  
    149. clean:compiler_clean
    150. -$(DEL_FILE) $(OBJECTS)
    151. -$(DEL_FILE) *~ core *.core
    152.  
    153.  
    154. ####### Sub-libraries
    155.  
    156. distclean: clean
    157. -$(DEL_FILE) $(TARGET)
    158. -$(DEL_FILE) Makefile
    159.  
    160.  
    161. mocclean: compiler_moc_header_clean compiler_moc_source_clean
    162.  
    163. mocables: compiler_moc_header_make_all compiler_moc_source_make_all
    164.  
    165. compiler_moc_header_make_all: moc_myqtapp.cpp
    166. compiler_moc_header_clean:
    167. -$(DEL_FILE) moc_myqtapp.cpp
    168. moc_myqtapp.cpp: ui_myqtapp.h \
    169. myqtapp.h
    170. /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) myqtapp.h -o moc_myqtapp.cpp
    171.  
    172. compiler_rcc_make_all:
    173. compiler_rcc_clean:
    174. compiler_image_collection_make_all: qmake_image_collection.cpp
    175. compiler_image_collection_clean:
    176. -$(DEL_FILE) qmake_image_collection.cpp
    177. compiler_moc_source_make_all:
    178. compiler_moc_source_clean:
    179. compiler_uic_make_all: ui_myqtapp.h
    180. compiler_uic_clean:
    181. -$(DEL_FILE) ui_myqtapp.h
    182. ui_myqtapp.h: myqtapp.ui
    183. /usr/bin/uic-qt4 myqtapp.ui -o ui_myqtapp.h
    184.  
    185. compiler_yacc_decl_make_all:
    186. compiler_yacc_decl_clean:
    187. compiler_yacc_impl_make_all:
    188. compiler_yacc_impl_clean:
    189. compiler_lex_make_all:
    190. compiler_lex_clean:
    191. compiler_clean: compiler_moc_header_clean compiler_uic_clean
    192.  
    193. ####### Compile
    194.  
    195. main.o: main.cpp myqtapp.h \
    196. ui_myqtapp.h
    197. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
    198.  
    199. myqtapp.o: myqtapp.cpp myqtapp.h \
    200. ui_myqtapp.h
    201. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o myqtapp.o myqtapp.cpp
    202.  
    203. moc_myqtapp.o: moc_myqtapp.cpp
    204. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_myqtapp.o moc_myqtapp.cpp
    205.  
    206. ####### Install
    207.  
    208. install: FORCE
    209.  
    210. uninstall: FORCE
    211.  
    212. FORCE:
    To copy to clipboard, switch view to plain text mode 

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qmake: does no generate .h file from .ui file

    What's wrong? Type make.

Similar Threads

  1. how to generate sis file with qt
    By fareenafatima in forum Newbie
    Replies: 2
    Last Post: 27th February 2011, 18:53
  2. how to generate a PDF file with qt?
    By ghnie in forum Qt Programming
    Replies: 1
    Last Post: 25th March 2010, 07:23
  3. Generate a form from an XML file.
    By cbarmpar in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2008, 15:54
  4. how to generate debug file???
    By sudheer in forum Qt Tools
    Replies: 2
    Last Post: 1st May 2008, 23:03
  5. how can i generate .cpp file in QT 4.3.0
    By gamitkumar in forum General Programming
    Replies: 4
    Last Post: 3rd September 2007, 22:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.