how to solve these error when building from command line
-
wrote on 9 Aug 2022, 12:43 last edited by rajel052 8 Sept 2022, 12:45
when i am running make command from terminal it gives error
make[3]: *** [Makefile:540: obj/qmuparserbase.o] Error 1
make[3]: Leaving directory '/home/rajel052/seamly2d/src/libs/qmuparser'
make[2]: *** [Makefile:60: sub-qmuparser-make_first] Error 2
make[2]: Leaving directory '/home/rajel052/seamly2d/src/libs'
make[1]: *** [Makefile:49: sub-libs-make_first] Error 2
make[1]: Leaving directory '/home/rajel052/seamly2d/src'
make: *** [Makefile:47: sub-src-make_first] Error 2 -
Hi,
The actual error is not in the lines you posted. It will be above.
Also, which version of Qt are you using in Qt Creator ?
Which one are you using on the command line ? -
wrote on 10 Aug 2022, 05:43 last edited by rajel052 8 Oct 2022, 05:43
Hii , @SGaist i am using Qt version 5.12.8
$ make
cd src/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/rajel052/seamly2d/src/src.pro ) && make -f Makefile
make[1]: Entering directory '/home/rajel052/seamly2d/src'
cd libs/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/rajel052/seamly2d/src/libs/libs.pro ) && make -f Makefile
make[2]: Entering directory '/home/rajel052/seamly2d/src/libs'
cd qmuparser/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/rajel052/seamly2d/src/libs/qmuparser/qmuparser.pro ) && make -f Makefile
make[3]: Entering directory '/home/rajel052/seamly2d/src/libs/qmuparser'
compiling qmuparserbase.cpp
cc1plus: warning: /usr/include/x86_64-linux-gnu/qt5/QtXmlPatterns: No such file or directory [-Wmissing-include-dirs]
cc1plus: warning: /usr/include/x86_64-linux-gnu/qt5/QtSvg: No such file or directory [-Wmissing-include-dirs]
qmuparserbase.cpp: In member function ‘void qmu::QmuParserBase::StackDump(const QStack<qmu::QmuParserToken<double, QString> >&, const QStack<qmu::QmuParserToken<double, QString> >&) const’:
qmuparserbase.cpp:1891:21: error: ‘dec’ is not a member of ‘Qt’
1891 | qDebug() << Qt::dec;
| ^~~
qmuparserbase.cpp:1891:21: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QTextStream:1,
from qmuparserbase.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qtextstream.h:238:28: note: ‘dec’
238 | Q_CORE_EXPORT QTextStream &dec(QTextStream &s);
| ^~~
In file included from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qbytearray.h:53,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:49,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qhashfunctions.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:47,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qmap.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/QMap:1,
from qmuparserbase.h:28,
from qmuparserbase.cpp:22:
/usr/include/c++/9/bits/ios_base.h:1028:3: note: ‘std::dec’
1028 | dec(ios_base& __base)
| ^~~
make[3]: *** [Makefile:540: obj/qmuparserbase.o] Error 1
make[3]: Leaving directory '/home/rajel052/seamly2d/src/libs/qmuparser'
make[2]: *** [Makefile:60: sub-qmuparser-make_first] Error 2
make[2]: Leaving directory '/home/rajel052/seamly2d/src/libs'
make[1]: *** [Makefile:49: sub-libs-make_first] Error 2
make[1]: Leaving directory '/home/rajel052/seamly2d/src'
make: *** [Makefile:47: sub-src-make_first] Error 2 -
From the looks of it, you are using your distribution provided Qt on the command line and you did not install all the development packages required.
When on the command line, use the full path to the qmake executable that you want to use to build your application.
-
Check your distribution package manager.
Or since you have installed Qt using the online installer: use the full path to the qmake executable that your can find in the bin folder of the Qt version you installed with the online installer.
-
Hii , @SGaist i am using Qt version 5.12.8
$ make
cd src/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/rajel052/seamly2d/src/src.pro ) && make -f Makefile
make[1]: Entering directory '/home/rajel052/seamly2d/src'
cd libs/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/rajel052/seamly2d/src/libs/libs.pro ) && make -f Makefile
make[2]: Entering directory '/home/rajel052/seamly2d/src/libs'
cd qmuparser/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/rajel052/seamly2d/src/libs/qmuparser/qmuparser.pro ) && make -f Makefile
make[3]: Entering directory '/home/rajel052/seamly2d/src/libs/qmuparser'
compiling qmuparserbase.cpp
cc1plus: warning: /usr/include/x86_64-linux-gnu/qt5/QtXmlPatterns: No such file or directory [-Wmissing-include-dirs]
cc1plus: warning: /usr/include/x86_64-linux-gnu/qt5/QtSvg: No such file or directory [-Wmissing-include-dirs]
qmuparserbase.cpp: In member function ‘void qmu::QmuParserBase::StackDump(const QStack<qmu::QmuParserToken<double, QString> >&, const QStack<qmu::QmuParserToken<double, QString> >&) const’:
qmuparserbase.cpp:1891:21: error: ‘dec’ is not a member of ‘Qt’
1891 | qDebug() << Qt::dec;
| ^~~
qmuparserbase.cpp:1891:21: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QTextStream:1,
from qmuparserbase.cpp:28:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qtextstream.h:238:28: note: ‘dec’
238 | Q_CORE_EXPORT QTextStream &dec(QTextStream &s);
| ^~~
In file included from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qbytearray.h:53,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:49,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qhashfunctions.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:47,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qmap.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/QMap:1,
from qmuparserbase.h:28,
from qmuparserbase.cpp:22:
/usr/include/c++/9/bits/ios_base.h:1028:3: note: ‘std::dec’
1028 | dec(ios_base& __base)
| ^~~
make[3]: *** [Makefile:540: obj/qmuparserbase.o] Error 1
make[3]: Leaving directory '/home/rajel052/seamly2d/src/libs/qmuparser'
make[2]: *** [Makefile:60: sub-qmuparser-make_first] Error 2
make[2]: Leaving directory '/home/rajel052/seamly2d/src/libs'
make[1]: *** [Makefile:49: sub-libs-make_first] Error 2
make[1]: Leaving directory '/home/rajel052/seamly2d/src'
make: *** [Makefile:47: sub-src-make_first] Error 2Lifetime Qt Championwrote on 13 Aug 2022, 08:37 last edited by Christian Ehrlicher@rajel052 said in how to solve these error when building from command line:
1891 | qDebug() << Qt::dec;
Also this is wrong - Qt has no functiondec
, but std has: std::dec -
@rajel052 said in how to solve these error when building from command line:
1891 | qDebug() << Qt::dec;
Also this is wrong - Qt has no functiondec
, but std has: std::dec -
@mrjj said in how to solve these error when building from command line:
qDebug() << Qt::dec;
Then the include for QTextStream is missing. :)
-
@mrjj said in how to solve these error when building from command line:
qDebug() << Qt::dec;
Then the include for QTextStream is missing. :)
@Christian-Ehrlicher
Just saw it suggest it under
qmuparserbase.cpp:1891:21: note: suggested alternatives:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qtextstream.h:238:28: note: ‘dec’
238 | Q_CORE_EXPORT QTextStream &dec(QTextStream &s);So yeah it could be that simple :)
-
wrote on 24 Aug 2022, 04:47 last edited by rajel052
Hi , Not Solved yet
how to build on 5.12.8 distribution provided
how to install required development packages
how to use full path to the qmake executable. -
Hi , Not Solved yet
how to build on 5.12.8 distribution provided
how to install required development packages
how to use full path to the qmake executable.wrote on 24 Aug 2022, 05:53 last edited byhow to build on 5.12.8 distribution provided
You have not told us who provided the distribution
how to install required development packages
That depends on the distribution.
For Ubuntu 20.04 you can see the development packages here.how to use full path to the qmake executable.
$ locate qmake # Select one of the paths to a qmake executable that is shown on your system # Use that # Examples: $ /usr/bin/qmake $ /home/rajel052/Qt/.../bin/qmake
-
wrote on 24 Aug 2022, 06:48 last edited by rajel052This post is deleted!
-
how to build on 5.12.8 distribution provided
You have not told us who provided the distribution
how to install required development packages
That depends on the distribution.
For Ubuntu 20.04 you can see the development packages here.how to use full path to the qmake executable.
$ locate qmake # Select one of the paths to a qmake executable that is shown on your system # Use that # Examples: $ /usr/bin/qmake $ /home/rajel052/Qt/.../bin/qmake
wrote on 24 Aug 2022, 07:19 last edited by@ChrisW67
$ qmake /home/rajel052/Qt/5.15.2/gcc_64/bin/qmake
$ make
g++ -Wl,-O1 -o qmake /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libGL.so -lpthread
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function_start': (.text+0x24): undefined reference to
main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:147: qmake] Error 1 -
@ChrisW67
$ qmake /home/rajel052/Qt/5.15.2/gcc_64/bin/qmake
$ make
g++ -Wl,-O1 -o qmake /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libGL.so -lpthread
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function_start': (.text+0x24): undefined reference to
main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:147: qmake] Error 1@rajel052 said in how to solve these error when building from command line:
qmake /home/rajel052/Qt/5.15.2/gcc_64/bin/qmake
What is this?! You are supposed to call qmake using absolute path instead of just qmake:
/home/rajel052/Qt/5.15.2/gcc_64/bin/qmake PATH_TO_YOUR_PRO_FILE
Also, delete the content of your build folder before calling qmake.