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

<<QT::endl; replaced w/ << "QT::endl"; #28

Closed
musclecar289 opened this issue Mar 16, 2021 · 6 comments
Closed

<<QT::endl; replaced w/ << "QT::endl"; #28

musclecar289 opened this issue Mar 16, 2021 · 6 comments

Comments

@musclecar289
Copy link

Qt compilation error on Ubuntu 20.04.

To fix I replaced <<QT::endl; with << "QT::endl"; in mainwindow.cpp and todotxt.cpp.

Also needed to install:

 sudo apt install qtchooser
 sudo apt install qt5-default
 sudo apt install qtbase5-private-dev
 sudo apt install cmake
 sudo apt install libxcb-keysyms1-dev
@SverrirValgeirsson
Copy link
Owner

Hi. That was odd. I will look into it.
Know that the fix you have done will make the debug prints look weird (rather replace with "\n" for example), but that should be the only problem you will face.
Anyway, I will check out if I can recreate it. These symbols have been a bit of a mess since the Linux versions of Qt are lagging a bit compared to Mac and Windows, causing some errors like this one. .

@SverrirValgeirsson
Copy link
Owner

I added the dependency information to the README (https://github.com/SverrirValgeirsson/Todour/blob/master/README.md)

@SverrirValgeirsson
Copy link
Owner

Intresting that I get none of these errors when building on Ubuntu 20.04.
I tried on two different ones. I will close the issuse for now and lets re-open if others report the same issue.

@thomasoliveira
Copy link

thomasoliveira commented Apr 1, 2021

I am trying out Todour, and found the same as @musclecar289 regarding Qt::endl.

mainwindow.cpp: In constructor ‘MainWindow::MainWindow(QWidget*)’:
mainwindow.cpp:61:74: error: ‘endl’ is not a member of ‘Qt’

Using Ubuntu 20, where sudo apt install qt5-default installed version 5.12.8.
https://doc.qt.io/qt-5/qt.html#endl reports that Qt::endl was introduced in 5.14.

Suggestion for those having this issue: use the commands below to replace Qt::endl with "\n".

sed -i 's/Qt::endl/"\\n"/g' mainwindow.cpp
sed -i 's/Qt::endl/"\\n"/g' todotxt.cpp

@SverrirValgeirsson
Copy link
Owner

Hi.
Interesting, and you are absolutely right. I had some magic hiding this problem in my build (so I have obviously had this problem at some point).
sed -i 's/Qt::endl/endl/g' *.cpp does the trick as you point out above.

I will add a better solutions before closing this issue

@SverrirValgeirsson
Copy link
Owner

16fa5ea

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

No branches or pull requests

3 participants