I currently have a .pro of subprojects template. This .pro file references a lot of other .pro files, each one being a project itself. It compiles, builds and runs.
The problem is that each time I want to run my program, Qt Creator (or perhaps it's make itselfs) checks all projects' status or something like that. For each project it shows the following:
cd A_PROJECT_DIRECTORY && ( test -e Makefile ||
/opt/Qt5.5.1/5.5/gcc_64/bin/qmake A_PROJECT_DIRECTORY/PROJECT_FILE.pro
-spec linux-g++ CONFIG+=debug -o Makefile ) && /usr/bin/make -f Makefile
make[1]: Entering directory `A_PROJECT_DIRECTORY'
make[1]: Nothing to be done for `first'.
make[1]: Leaving directory `A_PROJECT_DIRECTORY'
It takes very little time for each one of those operations but there are so many projects that at the end it has a sensible impact in the edit + build + test workflow.
So, the question is: is there any way to skip those make "tests" or whatever are they and launch immediatly the executable after it has been built? Or some other way to speed up this process?
All the above is in Linux environment.
Thank you very much.
Related
I want to name my Qt application as
test <2>
So I write my .pro file as
TEMPLATE = app
TARGET = test\\\ \\\<2\\\>
QT = core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
SOURCES += main.cpp
But it fails when building:
11:14:31: Running steps for project asdf...
11:14:31: Configuration unchanged, skipping qmake step.
11:14:31: Starting: "/usr/bin/make"
/home/erik/Qt/5.11.1/gcc_64/bin/qmake -o Makefile ../asdf/asdf.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
WARNING: DESTDIR: Cannot access directory '../build-asdf-Desktop_Qt_5_11_1_GCC_64bit-Debug/test/ /<2'
/bin/sh: 1: cannot open 2/: No such file
/bin/sh: 1: cannot open 2/: No such file
Makefile:254: recipe for target 'test/ //<2/>' failed
make: *** [test/ //<2/>] Error 2
11:14:31: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project asdf (kit: Desktop Qt 5.11.1 GCC 64bit)
When executing step "Make"
11:14:31: Elapsed time: 00:00.
How should I escape the characters in TARGET?
You shouldn't, and in case of qmake: you can't, since the resulting makefiles will be unusable. Most operating systems reserve those characters, and while a file with such a name may be representable in the filesystem - it can't be used in typical ways. See e.g. Filename:Reserved characters and words for an overview.
The titles of application windows (e.g. as seen here) have nothing to do with file names. You can set them to whatever you want using QWidget's windowTitle property.
I'm trying to build https://github.com/AlbertWerner/cryptonotecoinwallet and facing an issue.
According to the README of the repo, I can run cmake command and it completes without any errors. But then, when I run make, it gives me the below error.
$ make
make: /usr/bin/cmake: Command not found
make: *** [Makefile:5138: cmake_check_build_system] Error 127
I'm using MSYS on Windows and here are the corresponding details.
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/mingw32/bin
$ which cmake
/mingw32/bin/cmake
Seems like it's looking for cmake in the wrong path.
Makefile
cmake_check_build_system:
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system # <== Line 5139
I'm not sure what's wrong. Please help me out.
Thanks.
Make sure that you launch MSYS2 using the mingw32.exe executable at the top level of your MSYS2 installation, and that you use that environment when you first run cmake. If you ran CMake in a different environment, remove all the files it created. The commands for running cmake and building the project should be something like this, assuming the developers have set it up in a reasonable way:
mkdir build
cd build
cmake .. -G"MSYS Makefiles"
make
I didn't try this myself because I am wary of running random code from the internet, but I found this note in the CMakefile indicating that the developers do not support MSYS2:
if (WIN32)
if (NOT MSVC)
message(FATAL_ERROR "Only MSVC is supported on this platform")
endif ()
...
So you will have to spend some effort on porting the Windows-specific code in this program to GCC if you really want to do this.
It took several painful days work to construct a autotools project. I got a configure file and it can generate a Makefile with several hundred lines of code. But when invoking make it only emits the following lines in 1 milliseconds.
make
make all-am
make[1]: Entering directory '/home/myacount/coding/orpara'
make[1]: Leaving directory '/home/myaccount/coding/orpara'
It seems that no work is done. The line that produced the output in the Makefile:
AUTOMAKE_OPTIONS = subdir-objects
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
My configure.ac file is not complicated:
....
AM_INIT_AUTOMAKE([-Wall -Werror])
AM_PROG_AR
AC_CONFIG_SRCDIR([src/interval.cpp])
AC_CONFIG_HEADERS([config.h])
LT_PREREQ([2.4])
LT_INIT([dlopen])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_LANG([C], [C++])
# Checks for libraries.
I have no clue where to start my debug. I am using automake to generate the makefile.
My Makefile.am in the top level directory is simple:
ACLOCAL_AMFLAGS = -I m4
SUBIDRS = src
The Makefile.am in the src directory has two targets (the PROGRAM primary is for testing only)
bin_PROGRAMS = GrishinDistance
GrishinDistance_SOURCES=GrishinDistance.cpp
Not showing the Makefile.am in subdir seqaln.
My problem is with the Makfile.am in the top directory:
SUBIDRS = src
A typo error with SUBDIRS => SUBIDRS.
If others have similar problem, you should be looking into these typo errors.
I am unable to compile a simple Qt project (an example with the mainwindow). I tried it via command shell and also on QtCreator. first qmake should create makefile with the command rule uic to translate as simple as it should my ui to a .h.
Qt Creator indicating the below warning / error messages on the console.
09:06:30: Running steps for project untitled...
09:06:30: Starting: "D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe" C:\workspace_llb_27-05-2016\untitled\untitled.pro -r -spec win32-g++
09:06:32: The process "D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe" exited normally.
09:06:32: Starting: "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe"
C:/mingw/mingwx64_481r0-sjlj-rev2/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug'
/C/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.sh ../workspace_llb_27-05-2016/untitled/mainwindow.ui -o ui_mainwindow.h
Makefile.Debug:318: recipe for target 'ui_mainwindow.h' failed
process_begin: CreateProcess(NULL, /C/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.sh ../workspace_llb_27-05-2016/untitled/mainwindow.ui -o ui_mainwindow.h, ...) failed.
make (e=2): Le fichier spécifié est introuvable.
mingw32-make[1]: *** [ui_mainwindow.h] Error 2
mingw32-make[1]: Leaving directory 'C:/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
09:06:33: The process "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project untitled (kit: Qt 5.6.0 (Built by mingwx64_481r0-sjlj-rev2))
When executing step "Make"
Thanks
I find the solution eventually. If It happens to me it could happen to anyone. Actually everything have worked before I install gitbash. I set as variable system the bin of gitbash to my path system. However gitbach contains sh.exe which unix tool. So everytime I build via Qtcreator or console 2 uic_wrapper were created one .sh one .bat and all my makefile were unix like. in nutshell never set any UNIX TOOL TO YOUR WINDOWS SYSTEM. Mingw could contain MSYS take care !! at least most of tools oriented development are UNIX like.
I am suspecting something wrong with your Desktop Kit maybe. I tried to create a new default mainwindow project just like how you did and I see the first few steps like below:
14:48:15: Running steps for project untitled...
14:48:15: Starting: "D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe" C:\untitled\untitled.pro -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
14:48:16: The process "D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe" exited normally.
14:48:16: Starting: "D:\Qt\Qt5.6.0\Tools\mingw492_32\bin\mingw32-make.exe"
D:/Qt/Qt5.6.0/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
You can notice there's a difference between the qmake path my application is using compared to yours.
Mine looks like this: D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe
Yours looks like this: D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe
And I guess qt-everywhere-opensource-src-5.6.0 looks like the Qt source code that you might have pulled from web. Hope this information gives you some pointer to figure out what's going wrong.
I have downloaded the Sip module for python 2.7, created a makefile and tried the make command on the directory with the makefile, but I get this error:
Makefile:3: recipe for target 'all' failed
mingw32-make[10]: *** [all] Error 2
mingw32-make[10]: Leaving directory 'D:/Users/myLogin/Downloads/python/sip-4.14.5'
I get this error with both Gnuwin and mingw32. So I'm at a loss at what to do now. Any idea?
If you use python configure.py, the generated Makefiles are actually nmake makefiles. nmake is Microsoft's equivalent to make. You can run it by invoking nmake in a Visual Studio command prompt, if you have that installed.
For building with mingw, you have to indicate that you want to use that particular platform when creating the makefiles, as follows:
python configure.py --platform win32-g++
After that, invoking make works fine.
A few details about what happens to you when running make on the nmake makefile. The generated nmake file starts with the following lines:
all:
cd sipgen
$(MAKE)
#cd ..
cd siplib
$(MAKE)
#cd ..
Because each command on each line is executed in a new shell, the result of cd sipgen is actually void. Then, make is invoked again, in the current directory -- this results in an infinite recursive loop of make invocations. The [10] in your error message indicates that it was at the 10th level of recursion. I guess that was the moment that you pressed Ctrl-C :-)