Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fails - std c++11 not set #244

Closed
jounathaen opened this issue Nov 28, 2016 · 10 comments
Closed

Make fails - std c++11 not set #244

jounathaen opened this issue Nov 28, 2016 · 10 comments

Comments

@jounathaen
Copy link
Member

@jounathaen jounathaen commented Nov 28, 2016

When I clone a new repository, run qmake and make, I get the following Errors:

mainwindow.cpp: In constructor ‘MainWindow::MainWindow(QWidget*)’:
mainwindow.cpp:37:24: error: ‘nullptr’ was not declared in this scope
       tray(NULL), pass(nullptr) {
                        ^
mainwindow.cpp: In member function ‘bool MainWindow::checkConfig()’:
mainwindow.cpp:353:15: error: ‘nullptr’ was not declared in this scope
   if (pass == nullptr) {
               ^
Makefile:691: recipe for target 'mainwindow.o' failed
make: *** [mainwindow.o] Error 

I get the following warnings as well:

imitatepass.h:14:24: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11
   virtual void GitInit() override;
                        ^
imitatepass.h:15:24: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11
   virtual void GitPull() override;
                        ^
imitatepass.h:16:24: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11
   virtual void GitPush() override;
                        ^
imitatepass.h:17:69: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11
   virtual QProcess::ExitStatus Show(QString file, bool block = false) override;
                                                                     ^
...

and simmilar ones for other classes.

Compile command invoked by make is:
g++ -c -m64 -pipe -DSINGLE_APP=1 -O2 -Wall -W -Wno-unknown-pragmas -D_REENTRANT -fPIC -DVERSION="\"1.1.5\"" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o main.o main.cpp
System is Linux Mint 18

When I add -std=c++11 , it compiles. But this is not set as default in make

@annejan
Copy link
Member

@annejan annejan commented Nov 28, 2016

Can you check if the tagged 1.1.5 release gives you the same error?

In the past I chose to convert all nice C++11 stuff to the older equivalents to make compilation easier on older OSs . .
Some might have slipped in the refactoring .. also .. tell me if we should default to C++11

@jounathaen
Copy link
Member Author

@jounathaen jounathaen commented Nov 28, 2016

Well, I didn't check the 1.1.5 Release, but it worked before the last refactoring.
Hmmm, C++11 is nice, but there are probably some systems, running qtpass which are older than 5 Years.
On the other hand: Didn't we drop qt4 support? qt5 is even younger than c++11

@tezeb
Copy link
Contributor

@tezeb tezeb commented Nov 28, 2016

It must have been me, I'm used to it.
On the other hand C++11 is default for QtCreator since almost 2 years(version 2.7).

@jounathaen
Copy link
Member Author

@jounathaen jounathaen commented Nov 28, 2016

Well, I'm not quiet sure, but I think in my default Ubuntu installation of qtcreator, it isn't (3.5.1)
(Or tell me how to check. I looked in Manage Kits -> Compilers -> Auto Detected)

@tezeb
Copy link
Contributor

@tezeb tezeb commented Nov 28, 2016

At least they claim so at version 2.7 release page. I have no idea how to check this.
I'm running 4.1 and it compiles without modifications.

@annejan
Copy link
Member

@annejan annejan commented Nov 28, 2016

Same for me, travis and appveyor . . they all do c++11
But dropping support for older compilers kind of sucks . .
I think there is still Qt4 support (as in it compiles) although I have no idea how usable it is on qt4 . .

@tezeb
Copy link
Contributor

@tezeb tezeb commented Dec 5, 2016

Also snap-CI fails because of no c++11 being set.

@annejan so what's the decision?

@annejan
Copy link
Member

@annejan annejan commented Dec 5, 2016

Let's set c++11 as standard and if for-example CentOS 6 has trouble with it I can provide them with a patch to not use c++11 for their builds 💃
I agree that c++11 makes a lot of things way more readable . .

Snap-CI mostly fails because of memory issues and me not willing to pay for more memory 😉
Should probably just drop snap since it's failing more often than not . .

@tezeb
Copy link
Contributor

@tezeb tezeb commented Dec 5, 2016

It shouldn't be that bad. Assuming up-to-date CentOS 6.8, it has gcc 4.4 with following c++0x support.
nullptr and override are not supported, but that's syntactic sugar...

@annejan annejan closed this in 45ccd60 Dec 5, 2016
@annejan
Copy link
Member

@annejan annejan commented Dec 5, 2016

I'll have to check if the config c++11 is enough for most systems . .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants