Results 1 to 3 of 3

Thread: g++ include path

  1. #1
    Join Date
    May 2007
    Posts
    46
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default g++ include path

    Hello to all,
    I made .pro file:
    Qt Code:
    1. TEMPLATE = app
    2.  
    3. SOURCES += main.cpp
    4. SOURCES += src/GetFile.cpp
    5. SOURCES += src/small_alerter.cpp
    6.  
    7. HEADERS += header/GetFile.h
    8. HEADERS += header/small_alerter.h
    9.  
    10. CONFIG += qt
    To copy to clipboard, switch view to plain text mode 
    got makefile:
    Qt Code:
    1. #############################################################################
    2. # Makefile for building: original
    3. # Generated by qmake (2.01a) (Qt 4.2.3) on: Mon May 7 20:18:04 2007
    4. # Project: original.pro
    5. # Template: app
    6. # Command: /usr/bin/qmake -unix -o Makefile original.pro
    7. #############################################################################
    8.  
    9. ####### Compiler, tools and options
    10.  
    11. CC = gcc
    12. CXX = g++
    13. LEX = flex
    14. YACC = yacc
    15. DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
    16. CFLAGS = -pipe -O2 -D_REENTRANT -Wall -W $(DEFINES)
    17. CXXFLAGS = -pipe -O2 -D_REENTRANT -Wall -W $(DEFINES)
    18. LEXFLAGS =
    19. YACCFLAGS = -d
    20. INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.
    21. LINK = g++
    22. LFLAGS =
    23. LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread
    24. AR = ar cqs
    25. RANLIB =
    26. QMAKE = /usr/bin/qmake
    27. TAR = tar -cf
    28. COMPRESS = gzip -9f
    29. COPY = cp -f
    30. COPY_FILE = $(COPY)
    31. COPY_DIR = $(COPY) -r
    32. INSTALL_FILE = install -m 644 -p
    33. INSTALL_DIR = $(COPY_DIR)
    34. INSTALL_PROGRAM = install -m 755 -p
    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. SOURCES = main.cpp \
    49. src/GetFile.cpp \
    50. src/small_alerter.cpp moc_GetFile.cpp \
    51. moc_small_alerter.cpp
    52. OBJECTS = main.o \
    53. GetFile.o \
    54. small_alerter.o \
    55. moc_GetFile.o \
    56. moc_small_alerter.o
    57. DIST = /usr/share/qt4/mkspecs/common/unix.conf \
    58. /usr/share/qt4/mkspecs/common/g++.conf \
    59. /usr/share/qt4/mkspecs/common/linux.conf \
    60. /usr/share/qt4/mkspecs/qconfig.pri \
    61. /usr/share/qt4/mkspecs/features/qt_functions.prf \
    62. /usr/share/qt4/mkspecs/features/qt_config.prf \
    63. /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
    64. /usr/share/qt4/mkspecs/features/default_pre.prf \
    65. /usr/share/qt4/mkspecs/features/release.prf \
    66. /usr/share/qt4/mkspecs/features/default_post.prf \
    67. /usr/share/qt4/mkspecs/features/qt.prf \
    68. /usr/share/qt4/mkspecs/features/unix/thread.prf \
    69. /usr/share/qt4/mkspecs/features/moc.prf \
    70. /usr/share/qt4/mkspecs/features/warn_on.prf \
    71. /usr/share/qt4/mkspecs/features/resources.prf \
    72. /usr/share/qt4/mkspecs/features/uic.prf \
    73. original.pro
    74. QMAKE_TARGET = original
    75. DESTDIR =
    76. TARGET = original
    77.  
    78. first: all
    79. ####### Implicit rules
    80.  
    81. .SUFFIXES: .o .c .cpp .cc .cxx .C
    82.  
    83. .cpp.o:
    84. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
    85.  
    86. .cc.o:
    87. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
    88.  
    89. .cxx.o:
    90. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
    91.  
    92. .C.o:
    93. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
    94.  
    95. .c.o:
    96. $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
    97.  
    98. ####### Build rules
    99.  
    100. all: Makefile $(TARGET)
    101.  
    102. $(TARGET): $(OBJECTS)
    103. $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
    104.  
    105. Makefile: original.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
    106. /usr/share/qt4/mkspecs/common/g++.conf \
    107. /usr/share/qt4/mkspecs/common/linux.conf \
    108. /usr/share/qt4/mkspecs/qconfig.pri \
    109. /usr/share/qt4/mkspecs/features/qt_functions.prf \
    110. /usr/share/qt4/mkspecs/features/qt_config.prf \
    111. /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
    112. /usr/share/qt4/mkspecs/features/default_pre.prf \
    113. /usr/share/qt4/mkspecs/features/release.prf \
    114. /usr/share/qt4/mkspecs/features/default_post.prf \
    115. /usr/share/qt4/mkspecs/features/qt.prf \
    116. /usr/share/qt4/mkspecs/features/unix/thread.prf \
    117. /usr/share/qt4/mkspecs/features/moc.prf \
    118. /usr/share/qt4/mkspecs/features/warn_on.prf \
    119. /usr/share/qt4/mkspecs/features/resources.prf \
    120. /usr/share/qt4/mkspecs/features/uic.prf
    121. $(QMAKE) -unix -o Makefile original.pro
    122. /usr/share/qt4/mkspecs/common/unix.conf:
    123. /usr/share/qt4/mkspecs/common/g++.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/qt.prf:
    133. /usr/share/qt4/mkspecs/features/unix/thread.prf:
    134. /usr/share/qt4/mkspecs/features/moc.prf:
    135. /usr/share/qt4/mkspecs/features/warn_on.prf:
    136. /usr/share/qt4/mkspecs/features/resources.prf:
    137. /usr/share/qt4/mkspecs/features/uic.prf:
    138. qmake: FORCE
    139. @$(QMAKE) -unix -o Makefile original.pro
    140.  
    141. dist:
    142. @$(CHK_DIR_EXISTS) .tmp/original1.0.0 || $(MKDIR) .tmp/original1.0.0
    143. $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/original1.0.0/ && $(COPY_FILE) --parents header/GetFile.h header/small_alerter.h .tmp/original1.0.0/ && $(COPY_FILE) --parents main.cpp src/GetFile.cpp src/small_alerter.cpp .tmp/original1.0.0/ && (cd `dirname .tmp/original1.0.0` && $(TAR) original1.0.0.tar original1.0.0 && $(COMPRESS) original1.0.0.tar) && $(MOVE) `dirname .tmp/original1.0.0`/original1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/original1.0.0
    144.  
    145.  
    146. yaccclean:
    147. lexclean:
    148. clean:compiler_clean
    149. -$(DEL_FILE) $(OBJECTS)
    150. -$(DEL_FILE) *~ core *.core
    151.  
    152.  
    153. ####### Sub-libraries
    154.  
    155. distclean: clean
    156. -$(DEL_FILE) $(TARGET)
    157. -$(DEL_FILE) Makefile
    158.  
    159.  
    160. /usr/bin/moc-qt4:
    161. (cd $(QTDIR)/src/tools/moc && $(MAKE))
    162.  
    163. mocclean: compiler_moc_header_clean compiler_moc_source_clean
    164.  
    165. mocables: compiler_moc_header_make_all compiler_moc_source_make_all
    166.  
    167. compiler_moc_header_make_all: moc_GetFile.cpp moc_small_alerter.cpp
    168. compiler_moc_header_clean:
    169. -$(DEL_FILE) moc_GetFile.cpp moc_small_alerter.cpp
    170. moc_GetFile.cpp: header/GetFile.h \
    171. /usr/bin/moc-qt4
    172. /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) header/GetFile.h -o moc_GetFile.cpp
    173.  
    174. moc_small_alerter.cpp: header/small_alerter.h \
    175. /usr/bin/moc-qt4
    176. /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) header/small_alerter.h -o moc_small_alerter.cpp
    177.  
    178. compiler_rcc_make_all:
    179. compiler_rcc_clean:
    180. compiler_image_collection_make_all: qmake_image_collection.cpp
    181. compiler_image_collection_clean:
    182. -$(DEL_FILE) qmake_image_collection.cpp
    183. compiler_moc_source_make_all:
    184. compiler_moc_source_clean:
    185. compiler_uic_make_all:
    186. compiler_uic_clean:
    187. compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_image_collection_clean compiler_moc_source_clean compiler_uic_clean
    188.  
    189. ####### Compile
    190.  
    191. main.o: main.cpp header/small_alerter.h \
    192. header/GetFile.h
    193. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
    194.  
    195. GetFile.o: src/GetFile.cpp header/GetFile.h
    196. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o GetFile.o src/GetFile.cpp
    197.  
    198. small_alerter.o: src/small_alerter.cpp header/small_alerter.h
    199. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o small_alerter.o src/small_alerter.cpp
    200.  
    201. moc_GetFile.o: moc_GetFile.cpp
    202. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_GetFile.o moc_GetFile.cpp
    203.  
    204. moc_small_alerter.o: moc_small_alerter.cpp
    205. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_small_alerter.o moc_small_alerter.cpp
    206.  
    207. ####### Install
    208.  
    209. install: FORCE
    210.  
    211. uninstall: FORCE
    212.  
    213. FORCE:
    To copy to clipboard, switch view to plain text mode 

    in header files I included QNetwork, QHttp and other h files, make said that these can't be found. So I search for include path for make (for g++).

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: g++ include path

    Add QT+=network to your project file and rerun qmake.

  3. The following user says thank you to wysota for this useful post:

    LMZ (8th May 2007)

  4. #3
    Join Date
    May 2007
    Posts
    46
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: g++ include path

    thanks a lot, it works!!!

Similar Threads

  1. QApplication: no such file or directory
    By jochen_r in forum Newbie
    Replies: 13
    Last Post: 15th November 2008, 21:46
  2. Calling a new form from current form
    By webgenius in forum Qt Programming
    Replies: 7
    Last Post: 8th April 2007, 19:50
  3. Can't create an object : initialisation problem ?
    By Nyphel in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2007, 09:07
  4. Replies: 7
    Last Post: 2nd June 2006, 12:48
  5. use button from another Window
    By raphaelf in forum Qt Programming
    Replies: 11
    Last Post: 2nd March 2006, 20:31

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.