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.
Related
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
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.
I'm trying to compile PhantomJS 2, which uses Qt5. I am running into this failure:
make[2]: Entering directory `/app/phantomjs/src/qt/qtbase/src/platformsupport'
g++ -c -include .pch/Qt5PlatformSupport -pipe -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_GRAPHICSVIEW -DQT_NO_GRAPHICSEFFECT -DQT_NO_STYLESHEET -DQT_NO_STYLE_CDE -DQT_NO_STYLE_CLEANLOOKS -DQT_NO_STYLE_MOTIF -DQT_NO_STYLE_PLASTIQUE -DQT_NO_CAST_FROM_ASCII -DQT_NO_FONTCONFIG -DQT_BUILD_PLATFORMSUPPORT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtPlatformSupport -I../../include/QtPlatformSupport/5.3.0 -I../../include/QtPlatformSupport/5.3.0/QtPlatformSupport -I../../include/QtGui/5.3.0 -I../../include/QtGui/5.3.0/QtGui -I../../include/QtGui -I../../include/QtCore/5.3.0 -I../../include/QtCore/5.3.0/QtCore -I../../include/QtCore -I.moc -o .obj/qbasicfontdatabase.o fontdatabases/basic/qbasicfontdatabase.cpp
In file included from ../../include/QtGui/5.3.0/QtGui/private/../../../../../src/gui/text/qfontengine_ft_p.h:58:0,
from ../../include/QtGui/5.3.0/QtGui/private/qfontengine_ft_p.h:1,
from fontdatabases/basic/qbasicfontdatabase.cpp:54:
/usr/include/ft2build.h:56:38: fatal error: freetype/config/ftheader.h: No such file or directory
#include <freetype/config/ftheader.h>
^
compilation terminated.
make[2]: *** [.obj/qbasicfontdatabase.o] Error 1
make[2]: Leaving directory `/app/phantomjs/src/qt/qtbase/src/platformsupport'
make[1]: *** [sub-platformsupport-make_first] Error 2
make[1]: Leaving directory `/app/phantomjs/src/qt/qtbase/src'
make: *** [sub-src-make_first] Error 2
I've installed freetype2:
$ find / -name ftheader.h
/usr/include/freetype2/freetype/config/ftheader.h
/app/phantomjs/src/qt/qtbase/src/3rdparty/freetype/include/freetype/config/ftheader.h
Not sure how to resolve this, since I don't have much experience with C/C++ building. I might have to add/change a prefix, but I'm not sure how.
If you look at the locations of the error (), there is the following comment right above it:
55 /* `<prefix>/include/freetype2' must be in your current inclusion path */
56 #include <freetype/config/ftheader.h>
Not sure why the build didn't resolve this on its own, since it's resolved other libraries it depends on, but adding -I /usr/include/freetype2 to the build configuration did the trick.
For the case of PhantomJS specifically, the full command was:
./build.sh --confirm --qt-config '-I /usr/include/freetype2'
I want to try using QML ShaderEffectItem on QGraphicsView
I have cloned files from https://qt.gitorious.org/qt-labs/qml1-shadersplugin how is written in post, and i have compiled this plugin in ~/Dev/GitRepo/qml1-shadersplugin$:
using QtCreator, compiles this file: qmlshadersplugin.pro
But now i run in this folder(~/Dev/GitRepo/qml1-shadersplugin): make install
And i have many: errors:
~/Dev/GitRepo/qml1-shadersplugin$ make installcd src/ && make -f Makefile install
make[1]: Entering directory `/home/goran/Dev/GitRepo/qml1-shadersplugin/src'
g++ -c -m32 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_PLUGIN -DQT_DECLARATIVE_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../QtSDK/Desktop/Qt/474/gcc/mkspecs/linux-g++-32 -I. -I../../../../QtSDK/Desktop/Qt/474/gcc/include/QtCore -I../../../../QtSDK/Desktop/Qt/474/gcc/include/QtGui -I../../../../QtSDK/Desktop/Qt/474/gcc/include/QtOpenGL -I../../../../QtSDK/Desktop/Qt/474/gcc/include/QtDeclarative -I../../../../QtSDK/Desktop/Qt/474/gcc/include -I/usr/X11R6/include -I. -o qmlshadersplugin_plugin.o qmlshadersplugin_plugin.cpp
In file included from ../../../../QtSDK/Desktop/Qt/474/gcc/include/QtOpenGL/QtOpenGL:5:0,
from shadereffectitem.h:46,
from qmlshadersplugin_plugin.cpp:43:
../../../../QtSDK/Desktop/Qt/474/gcc/include/QtOpenGL/qgl.h:77:20: fatal error: GL/gl.h: No such file or directory
compilation terminated.
make[1]: *** [qmlshadersplugin_plugin.o] Error 1
make[1]: Leaving directory `/home/igor/Dev/GitRepo/qml1-shadersplugin/src'
make: *** [sub-src-install_subtargets] Error 2
What's the problem ?
GL/gl.h: No such file or directory
This means that you either do not have opengl library installed (very unlikely), or you didn't enabled it in your qmake file (very likely). To enable opengl in the qmake file, you need to add this line :
QT += opengl
More about it here.
I decided to start working on a new C++ project and wanted to use the latest version of the Qt framework, which is 4.7.3. I also decided to use gcc 4.6 found [here] (http://www.equation.com/servlet/equation.cmd?fa=fortran) . The compiler seems to compile simple c++ files using the new c++0x standard.
The problem I'm having, is that I can't seem to be able to compile Qt 4.7.3 on MinGW with gcc 4.6. I keep getting the following error:
cd src\corelib\ && mingw32-make -f Makefile
mingw32-make[1]: Entering directory `D:/__dev/Qt/4.7.3/src/corelib'
mingw32-make -f Makefile.Debug all
mingw32-make[2]: Entering directory `D:/__dev/Qt/4.7.3/src/corelib'
D:\__dev\Qt\4.7.3\bin\moc.exe -DQT_SHARED -DQT_THREAD_SUPPORT -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_BUILD_CORE_LIB -DQT_NO_USING_N
AMESPACE -DQT_MAKEDLL -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -D_USE_MATH
_DEFINES -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_DLL -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -
DQT_HAVE_SSE2 -I"..\..\include" -I"..\..\include\QtCore" -I"tmp\rcc\debug_shared" -I"tmp" -I"global" -I"..\..\tools\shared" -I"..\
3rdparty\zlib" -I"..\3rdparty\harfbuzz\src" -I"..\3rdparty\md5" -I"..\3rdparty\md4" -I"..\..\include\ActiveQt" -I"tmp\moc\debug_sh
ared" -I"..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 animation\qabstractanimation.h -o tmp\moc\debug_shared\moc_qabstractanimation
.cpp
g++ -c -include tmp\obj\debug_shared\qt_pch.h -g -Wall -frtti -fexceptions -mthreads -DQT_SHARED -DQT_THREAD_SUPPORT -DUNICODE -DQ
T_LARGEFILE_SUPPORT -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_MAKEDLL -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_FAS
T_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -D_USE_MATH_DEFINES -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_DLL -DQT_HA
VE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"..\..\include" -I"..\..\include\QtCore" -I"tmp\rcc\debug_s
hared" -I"tmp" -I"global" -I"..\..\tools\shared" -I"..\3rdparty\zlib" -I"..\3rdparty\harfbuzz\src" -I"..\3rdparty\md5" -I"..\3rdpa
rty\md4" -I"..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qabstractanimatio
n.o animation\qabstractanimation.cpp
animation\qabstractanimation.cpp:896:38: fatal error: moc_qabstractanimation.cpp: No such file or directory
compilation terminated.
mingw32-make[2]: *** [tmp/obj/debug_shared/qabstractanimation.o] Error 1
mingw32-make[2]: Leaving directory `D:/__dev/Qt/4.7.3/src/corelib'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `D:/__dev/Qt/4.7.3/src/corelib'
mingw32-make: *** [sub-corelib-make_default-ordered] Error 2
Removing the line also doesn't help, cause it'll fail at another file. Now I'm kinda stuck though, because I don't know why it can't find the file.
I removed the source code i had, and installed the windows version of qt 4.7.3, but i can't compile with a program with gcc 4.6, something about undefined methods (probably because the libs are compiled with gcc 4.4, or so i think). So i decided to rebuild qt it with gcc 4.6. Now I get the following errors:
g++ -c -include tmp\obj\debug_shared\qt_pch.h -g -Wall -frtti -fexceptions -mthreads -DQT_SHARED -DQT_THREAD_SUPPORT -DUNICODE -DQ
T_LARGEFILE_SUPPORT -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_MAKEDLL -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_FAS
T_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -D_USE_MATH_DEFINES -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_DLL -DQT_HA
VE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"..\..\include" -I"..\..\include\QtCore" -I"tmp\rcc\debug_s
hared" -I"tmp" -I"global" -I"..\..\tools\shared" -I"..\3rdparty\zlib" -I"..\3rdparty\harfbuzz\src" -I"..\3rdparty\md5" -I"..\3rdpa
rty\md4" -I"..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\moc_qnamespace.o
tmp\moc\debug_shared\moc_qnamespace.cpp
tmp\moc\debug_shared\moc_qnamespace.cpp:196:16: error: 'WMouseNoMask' is not a member of 'Qt'
tmp\moc\debug_shared\moc_qnamespace.cpp:197:16: error: 'WDestructiveClose' is not a member of 'Qt'
[the list continues]
tmp\moc\debug_shared\moc_qnamespace.cpp:1022:17: error: 'PaletteLinkVisited' is not a member of 'Qt'
tmp\moc\debug_shared\moc_qnamespace.cpp:1023:17: error: 'X11ParentRelative' is not a member of 'Qt'
make[2]: *** [tmp/obj/debug_shared/moc_qnamespace.o] Error 1
make[2]: Leaving directory `D:/__dev/Qt/4.7.3/src/corelib'
make[1]: *** [debug-all] Error 2
make[1]: Leaving directory `D:/__dev/Qt/4.7.3/src/corelib'
make: *** [sub-corelib-make_default-ordered] Error 2
Does qabstractanimation have the QOBJECT macro in the declaration? Moc.exe may not be generating the file moc_qabstractanimation.cpp because it doesn't see the macro.