Unsolved Building Qt Source Code
-
Hi,
I am trying to build the Qt source code in Qt creator, but i am getting the following errors.
error: Cannot find feature qt_configure
error: system(execute) requires one or two arguments.
error: Cannot run compiler 'g++'. Output: -
You have to run configure script first.
-
@sierdzio ,
I am getting core dumped, after running configure script.$./configure -developer-build -opensource -nomake examples -nomake tests
Creating qmake...
.Done.
ASSERT: "!isEmpty()" in file ../include/QtCore/../../src/corelib/tools/qlist.h, line 347
Aborted (core dumped) -
- where you've got Qt code from? Git, single zip, tarball?
- what operating system are you using?
- there is no need to run
-developer-build
(unless you want to contribute to Qt) - which Qt version are you building?
- please run the configure with verbose flag set, that should give more info on where and why the compilation failed
-
- I got the code from Git
- I am using version Ubuntu
- I tried without -developer -build option, but still i am getting core dumped.
- I cloned from qt 5.11 branch
- How to use the verbose flag? Please explain me.
-
@Vinod-Kuntoji said in Building Qt Source Code:
- How to use the verbose flag? Please explain me.
I don't remember to be honest. Please run
./configure -help
and look for the flag. It was either-v
or-verbose
I think, or something similar.OK, on Ubuntu I recommend running this command before configuring:
sudo apt build-dep qt5-qmake
That should pull all Qt dependencies which you need.
Also, remember not to run configure on the same source twice. You need to clean up previous build before running configure again. Best way to do it is to build out-of-source, for example:
mkdir build cd build ./../configure <your configure flags> -prefix $PWD
If you want the output files (Qt installation) in a separate dir, you can specify something else in
-prefix
. -
@sierdzio,
I am getting following error
You cannot make a shadow build from a source tree containing a previous build.
Cannot proceed. -
Well the message is clear - your build dir is dirty. Remove Qt source code, download it and try again.
-
Thank you. I will try.
-
I cloned Qt5 from git again. Now i am getting make errors.
make[3]: *** [.obj/qfilesystemengine_unix.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory/home/user/qt5/qtbase/src/tools/bootstrap' make[2]: *** [sub-bootstrap-make_first] Error 2 make[2]: Leaving directory
/home/user/qt5/qtbase/src'
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/home/user/qt5/qtbase'
make: *** [module-qtbase-make_first] Error 2 -
Please post earlier lines from your output. These do not show what the problem is.
-
/home/user/qt5/qtbase/src/corelib/io/qfilesystemengine_unix.cpp:110:12: error: ‘int renameat2(int, const char*, int, const char*, unsigned int)’ defined but not used [-Werror=unused-function]
static int renameat2(int oldfd, const char *oldpath, int newfd, const char *newpath, unsigned flags)
^ -
@Vinod-Kuntoji said in Building Qt Source Code:
/home/user/qt5/qtbase/src/corelib/io/qfilesystemengine_unix.cpp:110:12: error: ‘int renameat2(int, const char*, int, const char*, unsigned int)’ defined but not used [-Werror=unused-function]
static int renameat2(int oldfd, const char *oldpath, int newfd, const char *newpath, unsigned flags)
^Sounds like you're still using
-developer-build
and warnings are errors. Since 5.11 is not yet released, such build failures are to be expected.