pentix / qjournalctl

A multi-platform, Qt-based frontend for systemd's journalctl command. Accepting local as well as remote (SSH) data sources.
GNU General Public License v3.0
166 stars 17 forks source link

Compilation errors #4

Closed najamelan closed 7 years ago

najamelan commented 7 years ago

I'm running debian testing with libqt4-dev version 4.8.7+dfsg-11.

There are several compilation errors which I don't find easy to solve and since I havn't done any qt development for years, I'm a bit stuck:

./ui_mainwindow.h:108:20: error: ‘class QTableView’ has no member named ‘setSizeAdjustPolicy’; did you mean ‘setSizePolicy’?
         tableView->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
                    ^~~~~~~~~~~~~~~~~~~
                    setSizePolicy
./ui_mainwindow.h:108:61: error: ‘AdjustToContents’ is not a member of ‘QAbstractScrollArea’
         tableView->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);

and:

In file included from src/showbootlog.cpp:9:0:
./src/showbootlog.h:36:53: error: ‘QDateTime’ does not name a type; did you mean ‘QTime’?
     void on_sinceDateTimeEdit_dateTimeChanged(const QDateTime &dateTime);
                                                     ^~~~~~~~~
                                                     QTime
./src/showbootlog.h:38:53: error: ‘QDateTime’ does not name a type; did you mean ‘QTime’?
     void on_untilDateTimeEdit_dateTimeChanged(const QDateTime &dateTime);
                                                     ^~~~~~~~~
                                                     QTime
src/showbootlog.cpp:159:6: error: prototype for ‘void ShowBootLog::on_sinceDateTimeEdit_dateTimeChanged(const QDateTime&)’ does not match any in class ‘ShowBootLog’
 void ShowBootLog::on_sinceDateTimeEdit_dateTimeChanged(const QDateTime &dateTime)
      ^~~~~~~~~~~
In file included from src/showbootlog.cpp:9:0:
./src/showbootlog.h:36:10: error: candidate is: void ShowBootLog::on_sinceDateTimeEdit_dateTimeChanged(const int&)
     void on_sinceDateTimeEdit_dateTimeChanged(const QDateTime &dateTime);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/showbootlog.cpp:164:6: error: prototype for ‘void ShowBootLog::on_untilDateTimeEdit_dateTimeChanged(const QDateTime&)’ does not match any in class ‘ShowBootLog’
 void ShowBootLog::on_untilDateTimeEdit_dateTimeChanged(const QDateTime &dateTime)
      ^~~~~~~~~~~
In file included from src/showbootlog.cpp:9:0:
./src/showbootlog.h:38:10: error: candidate is: void ShowBootLog::on_untilDateTimeEdit_dateTimeChanged(const int&)
     void on_untilDateTimeEdit_dateTimeChanged(const QDateTime &dateTime);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pentix commented 7 years ago

Hi @najamelan

I guess these errors are due to an incompability issue when trying to compile Qt5-based code using libqt4. I guess updating / installing and using libqt5 will fix your problem! 😃

najamelan commented 7 years ago

Ok,

thanks for clarifying that. I didn't realize it was supposed to compile with qt5 since the files have this in their header: Created by: Qt User Interface Compiler version 4.8.7. In order to have it include qt5 though I had to change the automake.sh file to have an absolute path to the qt5 qmake binary (which I found by running apt-file list qt5-qmake | grep 'qmake$').

Then it still didn't compile, got: QtGui/QAction: No such file or directory. I solved this by running rm ui_* *.o as described here.

Now it compiles with just a few warnings about unused parameters.

Since on gnome I can no longer run gui programs at the moment, I further had to do:

adduser <my username> systemd-journal

And to avoid having to log out:

nwgrp systemd-journal
nwgrp <my username>  # I didn't check with id -g because I know my primary group is the same as my username
./qjournalctl

few, I suppose I'm lucky to have internet at home...

pentix commented 7 years ago

@najamelan Great to hear it works for you now!

Thank you for reporting back! 😄

najamelan commented 7 years ago

I would suggest a simple mention in the readme for needing Qt5, and you could even put a link to this issue in case people need more hints.

As for the unused parameter warnings, just omit their names in your method definition as suggested here.

pentix commented 6 years ago

+1 for the hint on omitting the names. I'm going to do this when I find time!