Problem building stripped down version of Qt 4.6.2 - c++

I'm trying to build a smaller version of Qt, I used the following configuration options:
./configure -qt-sql-mysql -no-qt3support -no-audio-backend -no-phonon -no-phonon-backend -no-opengl -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-multimedia -fast
After executing make, I eventually run into the following error:
make[3]: Entering directory `/opt/qtsdk-2010.02/qt/tools/assistant/tools'
cd assistant/ && make -f Makefile
make[4]: Entering directory `/opt/qtsdk-2010.02/qt/tools/assistant/tools/assistant'
g++ -c -pipe -g -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB
-DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_SHARED
-I../../../../mkspecs/linux-g++ -I. -I../../../../include/QtCore
-I../../../../include/QtNetwork -I../../../../include/QtGui -I../../../../include/QtXml
-I../../../../include/QtSql -I../../../../include -I../../../../include/QtHelp
-I../../../shared/fontpanel -I.moc/release-shared -I.uic/release-shared
-o .obj/release-shared/helpviewer.o helpviewer.cpp
In file included from helpviewer.cpp:42:
helpviewer.h:51:20: error: QWebView: No such file or directory
Any pointers on what is wrong here?

It is trying to build the Assistant (that is the tool you us to view Qt documentation) tool, the Assistant needs webkit. If you don't need Assistant in your application when you are distributing it, just exclude it from the build

Related

QtTest/QtTest: No such file or directory

I try to perform Qt unit test app from Qt example (.../Qt/Examples/Qt-5.14.2/qtestlib/tutorial1/)
I do:
qmake -o Makefile tutorial1.pro
make
I get:
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtTest -I/usr/include/qt4 -I. -I. -o testqstring.o testqstring.cpp
testqstring.cpp:52:10: fatal error: QtTest/QtTest: No such file or directory
#include <QtTest/QtTest>
^~~~~~~~~~~~~~~
compilation terminated.
Makefile:205: recipe for target 'testqstring.o' failed
make: *** [testqstring.o] Error 1
What is wrong? I use xubuntu 18.04
Try calling qmake from Qt installation folder with:
<QT-PATH>/Qt/Qt-5.14.2/gcc_64/bin/qmake

QT 5.x compilation of Windows software on Linux

I'm trying to compile windows software on linux with qt but each time I try to compile I get the following error:
i686-w64-mingw32.static-g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I/mxe/usr/i686-w64-mingw32.static/qt5/include -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtSvg -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtWidgets -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtGui -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtNetwork -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -Irelease -I. -I/mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++ -o release/inventoryview.o View/inventoryview.cpp
In file included from View/inventoryview.cpp:2:0:
./ui_inventoryview.h:21:50: fatal error: Widget\Inventory\inventoryplusbutton.h: No such file or directory
compilation terminated.
Makefile.Release:6009: recipe for target 'release/inventoryview.o' failed
make[1]: Leaving directory '/builds/Skytwoo/qt-test/Synaps-Software'
make[1]: * [release/inventoryview.o] Error 1
Makefile:36: recipe for target 'release' failed
make: * [release] Error 2
I check multiple times and every folder exists.
Everything is run on Ubuntu inside a docker container with this command.
make -f Makefile.Release
As BoBTFish said, you can't have \ (backslashes) in your path. What you have to do here is to change Widget\Inventory\inventoryplusbutton.h into Widget/Inventory/inventoryplusbutton.h and make sure it exists.

Building SWipe Application

I'm currently trying to build this application https://github.com/ieatlint/SWipe on macOS and am not having any luck. I don't know much about building applications but this is what I have done so far.
git clone https://github.com/ieatlint/SWipe
cd SWipe
qmake SWipe.pro
make
And that's where I get an error:
make
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_NO_DEBUG -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/local/Cellar/qt/5.9.1/lib/QtMultimedia.framework/Headers -I/usr/local/Cellar/qt/5.9.1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt/5.9.1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt/5.9.1/lib/QtNetwork.framework/Headers -I/usr/local/Cellar/qt/5.9.1/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I/usr/local/Cellar/qt/5.9.1/mkspecs/macx-clang -F/usr/local/Cellar/qt/5.9.1/lib -o main.o main.cpp
main.cpp:1:10: fatal error: 'QtGui/QApplication' file not found
#include <QtGui/QApplication>
^
1 error generated.
make: *** [main.o] Error 1
I tried adding QT += widgets to the SWipe.pro file by using sudo nano SWipe.pro and adding it under where it says QT += core gui multimedia, but that didn't work.
I just cloned it quickly and had a look. Here is what's wrong with the code:
add widgets to the pro file as you already did (run qmake after this again)
in main.cpp change the include from QtGui/QApplication to just Application (as suggested by AlexanderVX)
Do the same in swipe.h for QtGui/QMainWindow and change it to just QMainWindow
in swipe.cpp change audioFormat.setFrequency( 48000 ) to audioFormat.setSampleRate( 48000 ), assuming that is what it should do as there is no setFrequency function
in swipe.cpp change audioFormat.setChannels( 1 ) to audioFormat.setChannelCount( 1 ), assuming that is what it should do as there is no setChannels function
I did this on my Mac and it builds this way. Have not run it though as I have not really looked into what this thing is doing... that's your job now I guess

qmake with Jenkins

I am trying to make Jenkins do the compile and build for me whenever I push commit to Git. I have a helloworld app created in Qt Creator. It does compile and build in Qt Creator, it does show on my phone, but it doesn't want to compile and build with Jenkins.
I am using the same shell commands which QtC used:
qmake helloworld.pro -r -spec android-g++;
make;
The console output is:
+ qmake helloworld.pro -r -spec android-g++
+ make
/home/ndk/toolchains/arm-linux-androideabi-4.9-/prebuilt/bin/arm-linux-androideabi-g++ -c -pipe -std=c++11 -O2 -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -mthumb -Wall -Wno-psabi -W -I/usr/share/qt4/mkspecs/android-g++ -I. -I. -I/home/ndk/sources/cxx-stl/gnu-libstdc++//include -I/home/ndk/sources/cxx-stl/gnu-libstdc++//libs//include -I/home/ndk/platforms//arch-arm//usr/include -o main.o main.cpp
In file included from main.cpp:1:0:
mainwindow.h:4:23: fatal error: QMainWindow: No such file or directory
#include <QMainWindow>
^
compilation terminated.
Makefile:187: recipe for target 'main.o' failed
make: *** [main.o] Error 1
My helloworld.pro:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = helloworld
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
CONFIG += mobility
MOBILITY =
main.cpp
#include "mainwindow.h"
#include <QMainWindow>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
EDIT/UPDATE:
So far, I have tried to specify the full path to qmake, to be sure that I use Qt's qmake.
/home/qt/5.7/android_armv7/bin/qmake helloworld.pro -r -spec android-g++;
make;
The output is:
/home/qt/5.7/android_armv7/bin/uic mainwindow.ui -o ui_mainwindow.h
/home/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove -std=c++11 -O2 -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -mthumb -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../qt/5.7/android_armv7/include -I../../qt/5.7/android_armv7/include/QtWidgets -I../../qt/5.7/android_armv7/include/QtGui -I../../qt/5.7/android_armv7/include/QtCore -I. -I. -I../../ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -I../../ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -I../../ndk/platforms/android-9/arch-arm/usr/include -I../../qt/5.7/android_armv7/mkspecs/android-g++ -o main.o main.cpp
/home/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -fno-builtin-memmove -std=c++11 -O2 -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -mthumb -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../qt/5.7/android_armv7/include -I../../qt/5.7/android_armv7/include/QtWidgets -I../../qt/5.7/android_armv7/include/QtGui -I../../qt/5.7/android_armv7/include/QtCore -I. -I. -I../../ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -I../../ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -I../../ndk/platforms/android-9/arch-arm/usr/include -I../../qt/5.7/android_armv7/mkspecs/android-g++ -o mainwindow.o mainwindow.cpp
mainwindow.cpp:3:25: fatal error: QtGui/QAction: No such file or directory
#include <QtGui/QAction>
^
compilation terminated.
Makefile:1780: recipe for target 'mainwindow.o' failed
make: *** [mainwindow.o] Error 1
Most likely your jenkins setup uses the wrong qmake. There's a 1:1 mapping between a Qt installation and its qmake. So, your install of Qt for android will have its own qmake that you must refer to by full path! Qt Creator sets up the path so that this happens automatically, Jenkins doesn't - and it shouldn't anyway.
When building for any particular Qt version, you only need to invoke its qmake explicitly. From then onwards, as long as the proper compiler is in the path, things will happen as they should and you don't ever need to refer to that Qt version manually again. The makefiles will all refer to Qt libraries, headers and tools from that Qt install.
You also don't need the -spec argument. Each Qt installation is compiled for a particular mkspec, so qmake itself knows exactly what the spec is. I have no idea why QtCreator gives that argument, it doesn't make much sense.
The only Qt header path that's in your commandline is the one for the mkspec. I would blame the server's Qt installation for this.
Ensure Qt for Android is properly installed on the server, and that it is its qmake you are calling.

make command is not working in QT command prompt

I am using QT 4.6.2 with MinGW 4.4. I have used
qmake –project
qmake example.pro
They are successfully executed. But While using make command from QT command prompt, giving me the following error,
C:\Users\musharrat.khan\Desktop\example>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/musharrat.khan/Desktop/example'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..
\..\..\Qt\4.6.2\include\QtCore" -I"..\..\..\..\Qt\4.6.2\include\QtGui" -I"..\..\..\..\Qt\4.6.2\include" -I"." -I"..\..\..\..\Qt\4.6.2\include\ActiveQt" -I"debug
" -I"..\..\..\..\Qt\4.6.2\mkspecs\win32-g++" -o debug\example.o example.cc
process_begin: CreateProcess(C:\Users\MUSHAR~1.KHA\AppData\Local\Temp\make4484-1.bat, C:\Users\MUSHAR~1.KHA\AppData\Local\Temp\make4484-1.bat, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make[1]: *** [debug/example.o] Error 2
mingw32-make[1]: Leaving directory `C:/Users/musharrat.khan/Desktop/example'
mingw32-make: *** [debug] Error 2
Are there any solution for this? I am using windows 8.1.