tuxclocker
tuxclocker copied to clipboard
Error on `make` command for install
The qmake
command worked perfectly fine, and I have libqt5x11extras5
installed, as well as the dev
version of the package. make
command threw this error:
In file included from mainwindow.h:10:0,
from main.cpp:1:
nvidia.h:6:10: fatal error: QtX11Extras/QX11Info: No such file or directory
#include <QtX11Extras/QX11Info>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:280: recipe for target 'main.o' failed
make: *** [main.o] Error 1
Is there a way to fix this?
I am running Ubuntu 18.04 with Xfce, and I made sure to have Qt libs installed, but I am willing to check to make sure I have the right ones.
Thanks!
Does changing that include to just <QX11Info> make any difference?
Doing that gives this error:
In file included from main.cpp:1:0:
mainwindow.h:169:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *gputemp = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:170:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *powerdraw = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:171:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *voltage = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:172:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *coreclock = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:173:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *memclock = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:174:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *coreutil = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:175:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *memutil = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:176:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *fanspeed = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:177:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *memusage = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:178:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *curmaxclk = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:179:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *curmaxmemclk = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:180:5: error: ‘QTreeWidgetItem’ does not name a type; did you mean ‘QWidgetItem’?
QTreeWidgetItem *curpowerlim = new QTreeWidgetItem;
^~~~~~~~~~~~~~~
QWidgetItem
mainwindow.h:184:5: error: ‘QScrollArea’ does not name a type
QScrollArea *plotScrollArea = new QScrollArea;
^~~~~~~~~~~
mainwindow.h:185:5: error: ‘QVBoxLayout’ does not name a type; did you mean ‘QCPLayout’?
QVBoxLayout *lo = new QVBoxLayout;
^~~~~~~~~~~
QCPLayout
mainwindow.h:187:5: error: ‘QVBoxLayout’ does not name a type; did you mean ‘QCPLayout’?
QVBoxLayout *plotLayout = new QVBoxLayout;
^~~~~~~~~~~
QCPLayout
mainwindow.h:207:9: error: ‘QVBoxLayout’ does not name a type; did you mean ‘QCPLayout’?
QVBoxLayout *layout;
^~~~~~~~~~~
QCPLayout
Makefile:280: recipe for target 'main.o' failed
make: *** [main.o] Error 1
I tried putting one include on one line and the other (so QtX11Extras on the first line and QX11Info on the next) and got this error:
In file included from mainwindow.h:10:0,
from main.cpp:1:
nvidia.h:6:10: fatal error: QtX11Extras: No such file or directory
#include <QtX11Extras>
^~~~~~~~~~~~~
compilation terminated.
Makefile:280: recipe for target 'main.o' failed
make: *** [main.o] Error 1
Looks like the compiler is trying to build against Qt 4 libraries. Check that you have a recent version of Qt 5 and make it use that.
Alright. I made sure to have Qt 5 installed. Went to run it again, with the file the way it was initially, it seems to have gotten farther along, but still threw an error. A different one though:
In file included from mainwindow.cpp:2:0:
ui_mainwindow.h:13:10: fatal error: QtGui/QAction: No such file or directory
#include <QtGui/QAction>
^~~~~~~~~~~~~~~
compilation terminated.
Makefile:481: recipe for target 'mainwindow.o' failed
make: *** [mainwindow.o] Error 1
There's still probably some outdated libraries it's trying to use considering that that file doesn't exist in the Qt 5 include folder but does in the Qt 4 one.
I tried removing all Qt4 libs from my system that I didn't need and got the new error again. Is there some other way to make it use the new libs? I'm don't compile code that often and have never dealt with Qt on this end of things before so I am lost. Lol
Sorry for causing so much trouble, thank you for the help!
I had this issue, here's what I had to do to fix it.
First I had to modify rojekti.pro change
QT += core gui
to
QT += core gui x11extras
Then I had to install libqt5x11extras5-dev with sudo apt install libqt5x11extras5-dev
Then for another reason I was missing NVCtrl.h so I had to sudo apt install libxnvctrl-dev
Hope this helps.
Alright. I made sure to have Qt 5 installed. Went to run it again, with the file the way it was initially, it seems to have gotten farther along, but still threw an error. A different one though:
In file included from mainwindow.cpp:2:0: ui_mainwindow.h:13:10: fatal error: QtGui/QAction: No such file or directory #include <QtGui/QAction> ^~~~~~~~~~~~~~~ compilation terminated. Makefile:481: recipe for target 'mainwindow.o' failed make: *** [mainwindow.o] Error 1
I tried the fix you did @jjordantb but the same error as what I have quoted above.
Is it possible that it's doing this cause I'm on a GTK based system and not Qt based? I find it unlikely that could cause it not to work but it may be possible. I don't know.
@Batcastle Try #include <QApplication>
instead of #include <QtGui/QAction>
after adding QT += widgets
to your .pro
file. That fixed it on a friend's system
if you are on opensuse you need
libqt5-creator and libqt5-qttools-devel
and use qmake-qt5 command instead of qmake
@guglovich Same problem on Gentoo. Looks like x11-drivers/nvidia-drivers
doesn't provide any headers at all.
UPD: on Gentoo it can be fixed by enabling the tools
and static-libs
use-flags. Details.
issue #5 Comment-461656164 @jjordantb This worked like a charm on Ubuntu Disco, that you sir!
@guglovich Same problem on Gentoo. Looks like
x11-drivers/nvidia-drivers
doesn't provide any headers at all.
UPD: on Gentoo it can be fixed by enabling the
tools
andstatic-libs
use-flags. Details.
How would I do this on Manjaro?
I've got exactly the same error as @Batcastle , and @jjordantb's suggestion didn't work for me. I'm running Ubuntu 18.04. I've got the qt5 libraries installed.
Hi, got a build error in Debian sid.
/usr/bin/ld: cannot find -lnvidia-ml
Guess I didn't have the proper .so file for some reason, but it was easily fixed.
ln -s /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 /usr/lib/x86_64-linux-gnu/libnvidia-ml.so
Make then completed successfully. Cheers!
I was also having problems and found that I needed this package: libqt5x11extras5-dev
I also needed to run qmake -qt=5 rojekti.pro
and not just qmake
. My system (Ubuntu 18.04) didn't have qmake-qt5
. It turned out that for me qmake
was a symlink to qtchooser
in qt4 mode and not qt5. Adding the -qt=5
fixed the problem of qt4 libraries being used.
It might also have been important to run make clean
in between attempts at running qmake and building.
I had this issue, here's what I had to do to fix it. First I had to modify rojekti.pro change
QT += core gui
toQT += core gui x11extras
Then I had to install libqt5x11extras5-dev with
sudo apt install libqt5x11extras5-dev
Then for another reason I was missing NVCtrl.h so I had tosudo apt install libxnvctrl-dev
Hope this helps.
thanks in order to install to ubuntu 20.04
i install
sudo apt install libxnvctrl
sudo apt-get install qt5-default
sudo apt-get install libqt5x11extras5-dev
sudo apt install libxnvctrl-dev
and later make and sudo make install
Closing due to the build changing since this issue.