Error Compiling Qt Source - qt

I have looked all around for a solution to this problem with no avail. When compiling Qt, it runs fine for about 60 seconds until I get this and it kicks me out:
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h
:65,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
from ..\..\..\include/QtCore/../../src/corelib/global/qglobal.h
:89,
from ..\..\..\include/QtCore/qglobal.h:1,
from ..\..\..\include/QtCore/../../src/corelib/tools/qalgorithm
s.h:45,
from ..\..\..\include/QtCore/qalgorithms.h:1,
from ..\..\..\include/QtCore/../../src/corelib/tools/qvector.h:
45,
from ..\..\..\include/QtCore/qvector.h:1,
from ..\..\..\include\QtCore/../../src/corelib/tools/qstack.h:4
5,
from ..\..\..\include\QtCore/qstack.h:1,
from parser.h:45,
from moc.h:45,
from moc.cpp:42:
c:\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
{ return (float)(_hypot (x, y)); }
^
Makefile.Release:307: recipe for target '.obj/release/moc.o' failed
mingw32-make[4]: *** [.obj/release/moc.o] Error 1
mingw32-make[4]: Leaving directory 'C:/Qt/QtS/qtbase/src/tools/moc'
Makefile:34: recipe for target 'release' failed
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Leaving directory 'C:/Qt/QtS/qtbase/src/tools/moc'
Makefile:82: recipe for target 'sub-moc-make_first' failed
mingw32-make[2]: *** [sub-moc-make_first] Error 2
mingw32-make[2]: Leaving directory 'C:/Qt/QtS/qtbase/src'
Makefile:41: recipe for target 'sub-src-make_first' failed
mingw32-make[1]: *** [sub-src-make_first] Error 2
mingw32-make[1]: Leaving directory 'C:/Qt/QtS/qtbase'
Makefile:63: recipe for target 'module-qtbase-make_first' failed
mingw32-make: *** [module-qtbase-make_first] Error 2
C:\Qt\QtS>
I am compiling using MinGW, and this is my first experience with compiling source really so I'm stumped on what to do.

If you Google a bit for error: '_hypot' was not declared in this scope you will find several reports from several different projects. Looks like a MinGW bug. Not too much you can do, if this is true.
Do you really need a 32bit Qt? According to Google at least one 64bit MinGW does not have this bug.
I would try it. Perhaps you find a newer MinGW version?
http://mingw-w64.yaxm.org/doku.php
EDIT:
Just found: https://wiki.qt.io/MinGW
There are binary installers targetting MinGW for both Qt 4 and Qt 5.
Up to Qt 4.8.6, Qt 4 ones are built with a MinGW.org toolchain using
gcc 4.4. Newer Qt 4.8 binary packages ship with a mingw-w64 based
toolchain. For Qt 5, a newer MinGW-w64 toolchain is actually required.

Related

qt5: Error class QTextBrowser’ has no member named ‘setMarkdown

I am trying to build a code from github but it gives error when the run the command sudo make. Please help. Also my qmake --version is
Using Qt version 5.14.2 in /opt/qt514/lib```
AboutDialog.cc
/home/admin/delegate/Degate/src/GUI/Dialog/AboutDialog.cc: In constructor ‘degate::AboutDialog::AboutDialog(QWidget*)’:
/home/admin/delegate/Degate/src/GUI/Dialog/AboutDialog.cc:92:19: error: ‘class QTextBrowser’ has no member named ‘setMarkdown’
92 | changelog.setMarkdown(in_changelog.readAll());
| ^~~~~~~~~~~
make[2]: *** [CMakeFiles/DegateCore.dir/build.make:3419: CMakeFiles/DegateCore.dir/src/GUI/Dialog/AboutDialog.cc.o] Error 1
make[2]: Leaving directory '/home/admin/delegate/Degate/build'
make[1]: *** [CMakeFiles/Makefile2:132: CMakeFiles/DegateCore.dir/all] Error 2
make[1]: Leaving directory '/home/admin/delegate/Degate/build'
make: *** [Makefile:133: all] Error 2
This was introduced in Qt 5.14 according to this ticket.
So, you are most likely using an older version. I would, in any case, advise you to use at least Qt 5.15. Even that version is only getting P0/P1 fixes at this point in time, let alone older versions. It is also an LTS version.
Degate has also got a bug that they should set the required Qt version in their project so that there are no surprises for their consumers.

An error occurred when the ASAP(Automated Slide Analysis Platform) software was running

With the enthusiastic help of SO netizens, I configured all the environments required for ASAP (Automated Slide Analysis Platform)
The necessary libraries including Boost, Openslide, Qt, etc. have been successfully linked, but the following error occurred
====================[ Build | ASAP | Debug ]====================================
"D:\_Jason\Clion\CLion 2021.2.2\bin\cmake\win\bin\cmake.exe" --build D:\_Jason\C++_hospital\orignal\CLion1.9\ASAP-1.9\cmake-build-debug --target ASAP -- -j 9
[ 25%] Automatic MOC and UIC for target ASAP
[ 25%] Built target ASAP_autogen
[ 50%] Linking CXX executable ASAP.exe
CMakeFiles\ASAP.dir/objects.a(main.cpp.obj): In function `main':
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationC1ERiPPci'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPC1EP7QWidget'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:8: undefined reference to `__imp__ZN7QWidget4showEv'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:10: undefined reference to `__imp__ZN12QApplication4execEv'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:7: undefined reference to `__imp__ZN4ASAPD1Ev'
D:/_Jason/C++_hospital/orignal/CLion1.9/ASAP-1.9/ASAP/main.cpp:6: undefined reference to `__imp__ZN12QApplicationD1Ev'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [CMakeFiles\ASAP.dir\build.make:111: ASAP.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:163: CMakeFiles/ASAP.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:170: CMakeFiles/ASAP.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:168: ASAP] Error 2
It can be seen from "__imp__ZN12QApplicationD1Ev" that this is a Qt problem. The solution they gave in other forums is to add the statement QT += gui widgets core to the .pro file under this project.However, there is no .pro file in the ASAP source code, so I tried to use the qmake -project command to generate the .pro file. It still doesn't work after adding QT += gui widgets core

Recipe for target failed (Qt Creator)

I have Hello World app that consists mainwindow.h, mainwindow.cpp, main.cpp and also mainwindow.ui. When I try to compile it, I receive following error messages:
E:\Qt\5.2.1\msvc2012_64_opengl\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
Makefile.Debug:226: recipe for target 'ui_mainwindow.h' failed
mingw32-make[1]: *** [ui_mainwindow.h] Error -1073741515
mingw32-make[1]: Leaving directory 'E:/Qt/workspace/Run'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2.
So I suppose ui_mainwindow.h is generated, but compiler can't find it at next step.
How can fix it?
The same problem was fixed (http://www.prog.org.ru/topic_27434_0.html). It seems no ICU DLLs in your bin dir.
(Change pathes for yours).
copy C:\icu\bin*.dll C:\Qt\Qt5.7.0n\bin\

Nginx-gridfs compiling #error must have a 64bit int type in Mac

running 10.7.2 follow the guide configure than append CFLAGS=-Wno-error to bypass the error, than I got stuck at
In file included from /usr/local/src/nginx-gridfs/mongo-c-driver/src/bson.h:24,
from /usr/local/src/nginx-gridfs/mongo-c-driver/src/mongo.h:24,
from /usr/local/src/nginx-gridfs/ngx_http_gridfs_module.c:43:
/usr/local/src/nginx-gridfs/mongo-c-driver/src/platform.h:50:2: error: #error must have a 64bit int type
make[1]: *** [objs/addon/nginx-gridfs/ngx_http_gridfs_module.o] Error 1
make: *** [build] Error 2
any idea?
I have had the same problem when compiling for Windows. You need to ensure you have a typedef for int64_t and uint64_t.
In order to address I needed to ensure that MONGO_USE__INT64 was defined.
For Mac you almost certainly have unistd.h available - so ensure you define MONGO_HAVE_UNISTD

PyQt make error while compiling the source code

I want to install PyQt for Qt 4.7.4 and i downloaded the packages SIP and PyQt from riverbankcomputing.co.uk.
I configured and installed SIP successfully and configured PyQt successfully. But when i ran make in the terminal i got this error:
/home/user/Desktop/PyQt-x11-gpl-4.8.5/QtCore/sipQtCoreQThread.cpp: In function ‘PyObject* meth_QThread_currentThreadId(PyObject*, PyObject*)’:
/home/user/Desktop/PyQt-x11-gpl-4.8.5/QtCore/sipQtCoreQThread.cpp:325:50: error: invalid conversion from ‘void*’ to ‘long unsigned int’
/home/user/Desktop/PyQt-x11-gpl-4.8.5/QtCore/sipQtCoreQThread.cpp:325:50: error: initializing argument 1 of ‘PyObject* PyLong_FromUnsignedLong(long unsigned int)’
make[1]: *** [sipQtCoreQThread.o] Error 1
make[1]: Leaving directory `/home/user/Desktop/PyQt-x11-gpl-4.8.5/QtCore'
make: *** [all] Error 2
The full log is here: http://www.text-upload.com/read.php?id=176672&c=5376703
Can you help me fix this error, please? Thank you!
According to the build log, PyQt's configure script has found and is using the Simulator/embedded variant of Qt, and not the Desktop variant.
Try passing the path to qmake of the Desktop variant to the configure script:
python ./configure.py -q /home/user/.QtSDK/Desktop/Qt/4.7.4/gcc/bin/qmake
There are two choices
python ./configure.py -q /home/user/.QtSDK/Desktop/Qt/4.7.4/gcc/bin/qmake
or
python ./configure.py -q /home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake
second will exit with some error code.
I'm trying first string right now.

Resources