tuxclocker icon indicating copy to clipboard operation
tuxclocker copied to clipboard

Error on `make` command for install

Open Batcastle opened this issue 5 years ago • 17 comments

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!

Batcastle avatar Feb 05 '19 18:02 Batcastle

Does changing that include to just <QX11Info> make any difference?

Lurkki14 avatar Feb 05 '19 19:02 Lurkki14

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

Batcastle avatar Feb 05 '19 20:02 Batcastle

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.

Lurkki14 avatar Feb 05 '19 21:02 Lurkki14

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

Batcastle avatar Feb 05 '19 22:02 Batcastle

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.

Lurkki14 avatar Feb 05 '19 22:02 Lurkki14

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!

Batcastle avatar Feb 06 '19 02:02 Batcastle

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.

jjordantb avatar Feb 08 '19 01:02 jjordantb

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 avatar Feb 08 '19 01:02 Batcastle

@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

hunterkepley avatar Feb 14 '19 17:02 hunterkepley

if you are on opensuse you need

libqt5-creator and libqt5-qttools-devel

and use qmake-qt5 command instead of qmake

Macribit avatar Feb 20 '19 20:02 Macribit

@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.

RazrFalcon avatar Feb 21 '19 12:02 RazrFalcon

issue #5 Comment-461656164 @jjordantb This worked like a charm on Ubuntu Disco, that you sir!

DeepInThought avatar Feb 21 '19 13:02 DeepInThought

@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.

How would I do this on Manjaro?

ghost avatar Feb 22 '19 11:02 ghost

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.

viggy96 avatar Mar 28 '19 21:03 viggy96

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!

dpanter avatar Jul 10 '19 22:07 dpanter

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.

JMadgwick avatar Aug 29 '19 19:08 JMadgwick

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.

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

jomarocas avatar Jun 17 '20 21:06 jomarocas