QT compile on terminal
-
Hi guys,
I use QT just because I am not familiar with MAKE .....
But now I have to use QT and also make. I try some kind of tutorial...
http://www.aboutlinux.info/2006/01/creating-and-compiling-qt-projects-on.html
When I make, I got errors:In file included from ./../SST/sparse_rrt/include/utilities/collision_check.hpp:3:0, from ./../SST/sparse_rrt/include/systems/system.hpp:18, from ../SST/sparse_rrt/include/systems/pendulum.hpp:16, from main.cpp:18: ./../SST/sparse_rrt/include/utilities/environmentc.hpp:6:21: fatal error: Fade_2D.h: No such file or directory #include "Fade_2D.h"
But the code can be run on the QT creator GUI.
I list the makefile:############################################################################# # Makefile for building: SSTSET_0616 # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue Sep 13 11:18:17 2016 # Project: SSTSET_0616.pro # Template: app # Command: /usr/lib/x86_64-linux-gnu/qt4/bin/qmake -o Makefile SSTSET_0616.pro ############################################################################# ####### Compiler, tools and options CC = gcc CXX = g++ DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) INCPATH = -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -IG1fitting-master/mex_srcs -I. LINK = g++ LFLAGS = -m64 -Wl,-O1 LIBS = $(SUBLIBS) -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lpthread AR = ar cqs RANLIB = QMAKE = /usr/lib/x86_64-linux-gnu/qt4/bin/qmake TAR = tar -cf COMPRESS = gzip -9f COPY = cp -f SED = sed COPY_FILE = $(COPY) COPY_DIR = $(COPY) -r STRIP = strip INSTALL_FILE = install -m 644 -p INSTALL_DIR = $(COPY_DIR) INSTALL_PROGRAM = install -m 755 -p DEL_FILE = rm -f SYMLINK = ln -f -s DEL_DIR = rmdir MOVE = mv -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p ####### Output directory OBJECTS_DIR = ./ ####### Files SOURCES = main.cpp \ G1fitting-master/mex_srcs/Clothoid.cpp \ G1fitting-master/mex_srcs/mex_buildClothoid.cc \ G1fitting-master/mex_srcs/mex_evalClothoid.cc \ G1fitting-master/mex_srcs/mex_FresnelCS.cc \ G1fitting-master/mex_srcs/mex_GeneralizedFresnelCS.cc \ G1fitting-master/mex_srcs/mex_pointsOnClothoid.cc OBJECTS = main.o \ Clothoid.o \ mex_buildClothoid.o \ mex_evalClothoid.o \ mex_FresnelCS.o \ mex_GeneralizedFresnelCS.o \ mex_pointsOnClothoid.o DIST = /usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/common/gcc-base.conf \ /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \ /usr/share/qt4/mkspecs/common/g++-base.conf \ /usr/share/qt4/mkspecs/common/g++-unix.conf \ /usr/share/qt4/mkspecs/qconfig.pri \ /usr/share/qt4/mkspecs/features/qt_functions.prf \ /usr/share/qt4/mkspecs/features/qt_config.prf \ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ /usr/share/qt4/mkspecs/features/default_pre.prf \ /usr/share/qt4/mkspecs/features/release.prf \ /usr/share/qt4/mkspecs/features/default_post.prf \ /usr/share/qt4/mkspecs/features/shared.prf \ /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ /usr/share/qt4/mkspecs/features/warn_on.prf \ /usr/share/qt4/mkspecs/features/qt.prf \ /usr/share/qt4/mkspecs/features/unix/thread.prf \ /usr/share/qt4/mkspecs/features/moc.prf \ /usr/share/qt4/mkspecs/features/resources.prf \ /usr/share/qt4/mkspecs/features/uic.prf \ /usr/share/qt4/mkspecs/features/yacc.prf \ /usr/share/qt4/mkspecs/features/lex.prf \ /usr/share/qt4/mkspecs/features/include_source_dir.prf \ SSTSET_0616.pro QMAKE_TARGET = SSTSET_0616 DESTDIR = TARGET = SSTSET_0616 first: all ####### Implicit rules .SUFFIXES: .o .c .cpp .cc .cxx .C .cpp.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .cc.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .cxx.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .C.o: $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" .c.o: $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" ####### Build rules all: Makefile $(TARGET) $(TARGET): $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) Makefile: SSTSET_0616.pro /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/linux.conf \ /usr/share/qt4/mkspecs/common/gcc-base.conf \ /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \ /usr/share/qt4/mkspecs/common/g++-base.conf \ /usr/share/qt4/mkspecs/common/g++-unix.conf \ /usr/share/qt4/mkspecs/qconfig.pri \ /usr/share/qt4/mkspecs/features/qt_functions.prf \ /usr/share/qt4/mkspecs/features/qt_config.prf \ /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ /usr/share/qt4/mkspecs/features/default_pre.prf \ /usr/share/qt4/mkspecs/features/release.prf \ /usr/share/qt4/mkspecs/features/default_post.prf \ /usr/share/qt4/mkspecs/features/shared.prf \ /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ /usr/share/qt4/mkspecs/features/warn_on.prf \ /usr/share/qt4/mkspecs/features/qt.prf \ /usr/share/qt4/mkspecs/features/unix/thread.prf \ /usr/share/qt4/mkspecs/features/moc.prf \ /usr/share/qt4/mkspecs/features/resources.prf \ /usr/share/qt4/mkspecs/features/uic.prf \ /usr/share/qt4/mkspecs/features/yacc.prf \ /usr/share/qt4/mkspecs/features/lex.prf \ /usr/share/qt4/mkspecs/features/include_source_dir.prf \ /usr/lib/x86_64-linux-gnu/libQtGui.prl \ /usr/lib/x86_64-linux-gnu/libQtCore.prl $(QMAKE) -o Makefile SSTSET_0616.pro /usr/share/qt4/mkspecs/common/unix.conf: /usr/share/qt4/mkspecs/common/linux.conf: /usr/share/qt4/mkspecs/common/gcc-base.conf: /usr/share/qt4/mkspecs/common/gcc-base-unix.conf: /usr/share/qt4/mkspecs/common/g++-base.conf: /usr/share/qt4/mkspecs/common/g++-unix.conf: /usr/share/qt4/mkspecs/qconfig.pri: /usr/share/qt4/mkspecs/features/qt_functions.prf: /usr/share/qt4/mkspecs/features/qt_config.prf: /usr/share/qt4/mkspecs/features/exclusive_builds.prf: /usr/share/qt4/mkspecs/features/default_pre.prf: /usr/share/qt4/mkspecs/features/release.prf: /usr/share/qt4/mkspecs/features/default_post.prf: /usr/share/qt4/mkspecs/features/shared.prf: /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: /usr/share/qt4/mkspecs/features/warn_on.prf: /usr/share/qt4/mkspecs/features/qt.prf: /usr/share/qt4/mkspecs/features/unix/thread.prf: /usr/share/qt4/mkspecs/features/moc.prf: /usr/share/qt4/mkspecs/features/resources.prf: /usr/share/qt4/mkspecs/features/uic.prf: /usr/share/qt4/mkspecs/features/yacc.prf: /usr/share/qt4/mkspecs/features/lex.prf: /usr/share/qt4/mkspecs/features/include_source_dir.prf: /usr/lib/x86_64-linux-gnu/libQtGui.prl: /usr/lib/x86_64-linux-gnu/libQtCore.prl: qmake: FORCE @$(QMAKE) -o Makefile SSTSET_0616.pro dist: @$(CHK_DIR_EXISTS) .tmp/SSTSET_06161.0.0 || $(MKDIR) .tmp/SSTSET_06161.0.0 $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/SSTSET_06161.0.0/ && $(COPY_FILE) --parents Clothoid.h G1fitting-master/mex_srcs/Clothoid.h ../SST/sparse_rrt/include/utilities/parameter_reader.hpp ../SST/sparse_rrt/include/utilities/condition_check.hpp ../SST/sparse_rrt/include/utilities/timer.hpp ../SST/sparse_rrt/include/utilities/random.hpp ../SST/sparse_rrt/include/systems/pendulum.hpp ../SST/sparse_rrt/include/systems/system.hpp ../SST/sparse_rrt/include/image_creation/svg_image.hpp ../SST/sparse_rrt/include/utilities/collision_check.hpp ../SST/sparse_rrt/include/utilities/environmentc.hpp ../SST/sparse_rrt/include/motion_planners/tree_node.hpp ../SST/sparse_rrt/include/systems/point.hpp ../SST/sparse_rrt/include/systems/car.hpp ../SST/sparse_rrt/include/systems/rally_car.hpp ../SST/sparse_rrt/include/systems/rc_car.hpp ../SST/sparse_rrt/include/motion_planners/clothoidcurve_class.hpp ../SST/sparse_rrt/include/systems/cart_pole.hpp ../SST/sparse_rrt/include/systems/two_link_acrobot.hpp ../SST/sparse_rrt/include/systems/snake_system.hpp ../SST/sparse_rrt/include/motion_planners/sst_0625.hpp ../SST/sparse_rrt/include/motion_planners/planner.hpp ../SST/sparse_rrt/include/nearest_neighbors/graph_nearest_neighbors.hpp ../SST/sparse_rrt/include/utilities/dijstra.hpp ../SST/sparse_rrt/include/motion_planners/rrt.hpp .tmp/SSTSET_06161.0.0/ && $(COPY_FILE) --parents main.cpp G1fitting-master/mex_srcs/Clothoid.cpp G1fitting-master/mex_srcs/mex_buildClothoid.cc G1fitting-master/mex_srcs/mex_evalClothoid.cc G1fitting-master/mex_srcs/mex_FresnelCS.cc G1fitting-master/mex_srcs/mex_GeneralizedFresnelCS.cc G1fitting-master/mex_srcs/mex_pointsOnClothoid.cc .tmp/SSTSET_06161.0.0/ && (cd `dirname .tmp/SSTSET_06161.0.0` && $(TAR) SSTSET_06161.0.0.tar SSTSET_06161.0.0 && $(COMPRESS) SSTSET_06161.0.0.tar) && $(MOVE) `dirname .tmp/SSTSET_06161.0.0`/SSTSET_06161.0.0.tar.gz . && $(DEL_FILE) -r .tmp/SSTSET_06161.0.0 clean:compiler_clean -$(DEL_FILE) $(OBJECTS) -$(DEL_FILE) *~ core *.core ####### Sub-libraries distclean: clean -$(DEL_FILE) $(TARGET) -$(DEL_FILE) Makefile check: first mocclean: compiler_moc_header_clean compiler_moc_source_clean mocables: compiler_moc_header_make_all compiler_moc_source_make_all compiler_moc_header_make_all: compiler_moc_header_clean: compiler_rcc_make_all: compiler_rcc_clean: compiler_image_collection_make_all: qmake_image_collection.cpp compiler_image_collection_clean: -$(DEL_FILE) qmake_image_collection.cpp compiler_moc_source_make_all: compiler_moc_source_clean: compiler_uic_make_all: compiler_uic_clean: compiler_yacc_decl_make_all: compiler_yacc_decl_clean: compiler_yacc_impl_make_all: compiler_yacc_impl_clean: compiler_lex_make_all: compiler_lex_clean: compiler_clean: ####### Compile main.o: main.cpp ../SST/sparse_rrt/include/utilities/parameter_reader.hpp \ ../SST/sparse_rrt/include/utilities/condition_check.hpp \ ../SST/sparse_rrt/include/utilities/timer.hpp \ ../SST/sparse_rrt/include/utilities/random.hpp \ ../SST/sparse_rrt/include/systems/pendulum.hpp \ ../SST/sparse_rrt/include/systems/system.hpp \ ../SST/sparse_rrt/include/image_creation/svg_image.hpp \ ../SST/sparse_rrt/include/utilities/collision_check.hpp \ ../SST/sparse_rrt/include/utilities/environmentc.hpp \ ../SST/sparse_rrt/include/motion_planners/tree_node.hpp \ ../SST/sparse_rrt/include/systems/point.hpp \ ../SST/sparse_rrt/include/systems/car.hpp \ ../SST/sparse_rrt/include/systems/rally_car.hpp \ ../SST/sparse_rrt/include/systems/rc_car.hpp \ ../SST/sparse_rrt/include/motion_planners/clothoidcurve_class.hpp \ ../SST/sparse_rrt/include/systems/cart_pole.hpp \ ../SST/sparse_rrt/include/systems/two_link_acrobot.hpp \ ../SST/sparse_rrt/include/systems/snake_system.hpp \ ../SST/sparse_rrt/include/motion_planners/sst_0625.hpp \ ../SST/sparse_rrt/include/motion_planners/planner.hpp \ ../SST/sparse_rrt/include/nearest_neighbors/graph_nearest_neighbors.hpp \ ../SST/sparse_rrt/include/utilities/dijstra.hpp \ ../SST/sparse_rrt/include/motion_planners/rrt.hpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp Clothoid.o: G1fitting-master/mex_srcs/Clothoid.cpp G1fitting-master/mex_srcs/Clothoid.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Clothoid.o G1fitting-master/mex_srcs/Clothoid.cpp mex_buildClothoid.o: G1fitting-master/mex_srcs/mex_buildClothoid.cc $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mex_buildClothoid.o G1fitting-master/mex_srcs/mex_buildClothoid.cc mex_evalClothoid.o: G1fitting-master/mex_srcs/mex_evalClothoid.cc $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mex_evalClothoid.o G1fitting-master/mex_srcs/mex_evalClothoid.cc mex_FresnelCS.o: G1fitting-master/mex_srcs/mex_FresnelCS.cc $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mex_FresnelCS.o G1fitting-master/mex_srcs/mex_FresnelCS.cc mex_GeneralizedFresnelCS.o: G1fitting-master/mex_srcs/mex_GeneralizedFresnelCS.cc $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mex_GeneralizedFresnelCS.o G1fitting-master/mex_srcs/mex_GeneralizedFresnelCS.cc mex_pointsOnClothoid.o: G1fitting-master/mex_srcs/mex_pointsOnClothoid.cc $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mex_pointsOnClothoid.o G1fitting-master/mex_srcs/mex_pointsOnClothoid.cc ####### Install install: FORCE uninstall: FORCE FORCE:
Also the .pro:
TEMPLATE = app CONFIG += console c++11 CONFIG -= app_bundle CONFIG -= qt SOURCES += main.cpp \ ../SST/sparse_rrt/src/image_creation/svg_image.cpp \ ../SST/sparse_rrt/src/motion_planners/planner.cpp \ ../SST/sparse_rrt/src/motion_planners/rrt.cpp \ ../SST/sparse_rrt/src/nearest_neighbors/graph_nearest_neighbors.cpp \ ../SST/sparse_rrt/src/systems/car.cpp \ ../SST/sparse_rrt/src/systems/cart_pole.cpp \ ../SST/sparse_rrt/src/systems/pendulum.cpp \ ../SST/sparse_rrt/src/systems/point.cpp \ ../SST/sparse_rrt/src/systems/rally_car.cpp \ ../SST/sparse_rrt/src/systems/rc_car.cpp \ ../SST/sparse_rrt/src/systems/two_link_acrobot.cpp \ ../SST/sparse_rrt/src/utilities/condition_check.cpp \ ../SST/sparse_rrt/src/utilities/parameter_reader.cpp \ ../SST/sparse_rrt/src/utilities/random.cpp \ ../SST/sparse_rrt/src/utilities/timer.cpp \ ../SST/sparse_rrt/src/utilities/environmentc.cpp \ ../SST/sparse_rrt/src/utilities/collision_check.cpp \ ../SST/sparse_rrt/src/motion_planners/clothoid.cpp \ ../SST/sparse_rrt/src/utilities/dijstra.cpp \ G1fitting-master/mex_srcs/Clothoid.cpp \ ../SST/sparse_rrt/src/motion_planners/sst_0625.cpp \ ../SST/sparse_rrt/src/systems/snake_system.cpp HEADERS += \ ../SST/sparse_rrt/include/image_creation/svg_image.hpp \ ../SST/sparse_rrt/include/motion_planners/planner.hpp \ ../SST/sparse_rrt/include/motion_planners/rrt.hpp \ ../SST/sparse_rrt/include/motion_planners/tree_node.hpp \ ../SST/sparse_rrt/include/nearest_neighbors/graph_nearest_neighbors.hpp \ ../SST/sparse_rrt/include/systems/car.hpp \ ../SST/sparse_rrt/include/systems/cart_pole.hpp \ ../SST/sparse_rrt/include/systems/pendulum.hpp \ ../SST/sparse_rrt/include/systems/point.hpp \ ../SST/sparse_rrt/include/systems/rally_car.hpp \ ../SST/sparse_rrt/include/systems/rc_car.hpp \ ../SST/sparse_rrt/include/systems/system.hpp \ ../SST/sparse_rrt/include/systems/two_link_acrobot.hpp \ ../SST/sparse_rrt/include/utilities/condition_check.hpp \ ../SST/sparse_rrt/include/utilities/parameter_reader.hpp \ ../SST/sparse_rrt/include/utilities/random.hpp \ ../SST/sparse_rrt/include/utilities/timer.hpp \ ../SST_Modifyed_0519/include/image_creation/gnuplot-iostream.h \ ../SST/sparse_rrt/include/utilities/collision_check.hpp \ ../SST/sparse_rrt/include/utilities/environmentc.hpp \ ../SST/sparse_rrt/include/motion_planners/clothoidcurve_class.hpp \ ../SST/sparse_rrt/include/utilities/dijstra.hpp \ ../SST/sparse_rrt/include/motion_planners/sst_0625.hpp \ ../SST/sparse_rrt/include/systems/snake_system.hpp INCLUDEPATH += /home/pracsys_user/Downloads/boost_1_60_0 INCLUDEPATH += /home/pracsys_user/fadeRelease/include_fade2d #INCLUDEPATH += /home/pracsys_user/SSTSET_0616 LIBS += "-L//home/pracsys_user/fadeRelease/lib_ubuntu14.04_x86_64" -lfade2d LIBS += "-L//home/pracsys_user/Downloads/boost_1_60_0/stage/lib/" -lboost_program_options LIBS += "-L/usr/local/lib" -lboost_iostreams -lboost_system LIBS += "-L/usr/local/lib" -lboost_filesystem
The fade2D.h is located in "INCLUDEPATH += /home/pracsys_user/fadeRelease/include_fade2dINCLUDEPATH += /home/pracsys_user/fadeRelease/include_fade2d" . Why it can not find it? How to add it to the makefile?
Thank you ahead!
-shan -
Hi,
Is
Fade_2d.h
directly in/home/pracsys_user/fadeRelease/include_fade2d
or in subfolder ? -
That's completely unrelated to GUI, it's a file not found error.
Just in case, did you re-ran qmake after adding these paths to
INCLUDEPATH
? -
Are you using Qt Creator or the command line for your development ?