Closed N0rbert closed 6 years ago
Hi, thank you very much for pinging me on this issue! Also thanks for helping out the other user in the AskUbuntu forum!
At the first sight it seems as if g++ does not automatically compile for C++11 (that's why it suggests to use the -std=c++11
. Also the variable nullptr
is defined when using the C++11 standard.
As a first workaround, you could execute ./autogen.sh
and then edit the Makefile
.
On approximately line 17 you should see something like
CXXFLAGS = -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wall -W -D_REENTRANT -fPIC $(DEFINES)
Add the flag there
CXXFLAGS = -std=c++11 -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wall -W -D_REENTRANT -fPIC $(DEFINES)
Then try again, running
make clean
make
I totally agree that it should not only run on bleeding-edge systems but Ubuntu just sometimes really takes years to update the software in their repositories, because compiling for C++11 should (in my opinion) not require any flag anymore (at least now, that C++14 and C++17 are already more or less published and used...) and gcc also already changed this some years ago.
BTW: I also found this (https://stackoverflow.com/a/44735016/2628569) code snippet to show you the default C++ version your compiler compiles.
I see that this is an issue and as soon as I find time I will add this as a default option so you won't have to edit the Makefile manually anymore. ☺️
Please tell me if the given workaround works for you! Thanks again!
Hi @pentix,
What about adding the CONFIG += c++11
[1] to the qjournalctl.pro
file ?
@dopsi Thanks for this, I didn't quite have the time to look it up but this seems like the most reasonable to do. In my environment this adds -std=gnu++11
to the Makefile.
@N0rbert Could you try to do
git pull make clean ./autogen.sh make
I hope by adding what @dopsi mentioned, it should compile now! 😄
Edit: I already plan some more stuff to be implemented soon (1 week, post-examination phase 😅), and I'm a bit short of time, that's why I did not increase and publish a new version for now. But compiling the master branch should work now :)
Thank you for fast response and fix! I cloned master again, it compiles and runs on Ubuntu 14.04 LTS, 16.04 LTS and 18.04 LTS without any user intervention.
I have installed all needed dependencies:
Cloned your repository and started compilation
and got the following error:
So your great program does not compile on LTS Ubuntu version. Only previous v.0.21 version compiles normally on Ubuntu. IMHO creating software only for bleeding-edge Arch is not good idea.
Note: first seen on AskUbuntu.