Compile error for Qt Designer Plugin

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
usbhub
Posts: 280
Joined: Tue Apr 02, 2019 8:22 pm
Location: Earth

Compile error for Qt Designer Plugin

Post by usbhub »

Hello,
I'm trying to build the QtDesigner plugin to create a settings page. I downloaded the FreeCAD source repo and ran qmake plugin.pro, but if I try to run make, it fails:

Code: Select all

otto@CELSIUS-M470-2:~/Dokumente/FreeCAD/src/Tools/plugins/widget$ qmake plugin.pro
otto@CELSIUS-M470-2:~/Dokumente/FreeCAD/src/Tools/plugins/widget$ make
g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtDesigner -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I. -I. -o customwidgets.o customwidgets.cpp
customwidgets.cpp:24:10: fatal error: QtGui: Datei oder Verzeichnis nicht gefunden
 #include <QtGui>
          ^~~~~~~
compilation terminated.
Makefile:223: recipe for target 'customwidgets.o' failed
make: *** [customwidgets.o] Error 1
How can I say make, where QtGui is?
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Compile error for Qt Designer Plugin

Post by wmayer »

QtGui is a file inside the QtGui directory of the Qt headers. Have a look at the generated Makefile and the list of include paths.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Compile error for Qt Designer Plugin

Post by vocx »

usbhub wrote: Wed Mar 25, 2020 8:04 pm

Code: Select all

otto@CELSIUS-M470-2:~/Dokumente/FreeCAD/src/Tools/plugins/widget$ qmake plugin.pro
Running just qmake may run the Qt4 version.

If you are compiling for Qt5, as the majority would do, you need to make sure you are using the Qt5 version.

Code: Select all

cd freecad-source/src/Tools/plugins/widget
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake plugin.pro
make
Compile_on_Linux
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
usbhub
Posts: 280
Joined: Tue Apr 02, 2019 8:22 pm
Location: Earth

Re: Compile error for Qt Designer Plugin

Post by usbhub »

wmayer wrote: Wed Mar 25, 2020 9:07 pm QtGui is a file inside the QtGui directory of the Qt headers. Have a look at the generated Makefile and the list of include paths.
You mean this, right?

Code: Select all

INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtDesigner -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I. -I.
Honestly, I don't really understand the Makefile, but for me "-I/usr/include/qt4/QtGui" looks like QtGui is included.

@vocx
Oh, right, I forgot. But the error is still there wit Qt5.
usbhub
Posts: 280
Joined: Tue Apr 02, 2019 8:22 pm
Location: Earth

Re: Compile error for Qt Designer Plugin

Post by usbhub »

Bump :)

Any information missing?
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Compile error for Qt Designer Plugin

Post by wmayer »

Independent of whether Qt4 or Qt5 is used you have the following include paths:
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtDesigner -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I. -I.
Now the compiler tells you that QtGui cannot be found. Does the directory /usr/include/qt4/QtGui actually exist and if yes does it include the file QtGui?

Btw, it would be helpful to tell us which OS exactly you are using.
usbhub
Posts: 280
Joined: Tue Apr 02, 2019 8:22 pm
Location: Earth

Re: Compile error for Qt Designer Plugin

Post by usbhub »

wmayer wrote: Thu Apr 09, 2020 8:24 am Independent of whether Qt4 or Qt5 is used you have the following include paths:
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtDesigner -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I. -I.
Now the compiler tells you that QtGui cannot be found. Does the directory /usr/include/qt4/QtGui actually exist and if yes does it include the file QtGui?

Btw, it would be helpful to tell us which OS exactly you are using.
The folder /usr/include/qtXX didn't existed, so I installed all packages beginning with qt4, now it works :)
Now I will try to do it for qt5.

Thanks for your help!

PS: Just for completeness:
OS: Linux Mint 19 Cinnamon
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Compile error for Qt Designer Plugin

Post by vocx »

usbhub wrote: Fri Apr 10, 2020 11:04 pm ...
The folder /usr/include/qtXX didn't existed, so I installed all packages beginning with qt4, now it works :)
Now I will try to do it for qt5.
Are you even following the compiling information? Compile on Linux tells you which dependencies you need to install for Debian/Ubuntu based distributions.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
usbhub
Posts: 280
Joined: Tue Apr 02, 2019 8:22 pm
Location: Earth

Re: Compile error for Qt Designer Plugin

Post by usbhub »

vocx wrote: Sat Apr 11, 2020 3:18 pm
usbhub wrote: Fri Apr 10, 2020 11:04 pm ...
The folder /usr/include/qtXX didn't existed, so I installed all packages beginning with qt4, now it works :)
Now I will try to do it for qt5.
Are you even following the compiling information? Compile on Linux tells you which dependencies you need to install for Debian/Ubuntu based distributions.
Yes, that would be a very good idea…
For QT5 it worked "out of the box" after installing the dependencies :)

Thank you very much!
Post Reply