No header generated with uic - qt

QtCreator doesn't want to create my ui header file. When I enter uic in the terminal it says me this :
louis#Krusty:~$ uic
uic: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/uic': No such file or directory
I have Qt5 installed in my home folder, Qt recognized it without issue. In the settings, it's in the good folder. Normaly it shouldn't has any problem ! But it has, so I have to create my form by hand :
./.Qt/5.5/gcc_64/bin/uic Documents/lab/Qt/OpenPlane/AirplaneEditor.ui -o ui_AirplaneEditor.h
This is my QMake :
QT += widgets
SOURCES += \
main.cpp \
Airplane.cpp \
AirplaneOverview.cpp \
AirplaneManager.cpp \
AirplaneEditor.cpp
HEADERS += \
Airplane.h \
AirplaneOverview.h \
AirplaneManager.h \
AirplaneEditor.h \
ui_AirplaneEditor.h # By hand
FORMS += \
AirplaneEditor.ui
If you need more informations, ask me!

From the usefull comments from #bibi:
Looks like your PATH does not include ~/.Qt/5.5/gcc_64/bin/, and/or not before the regular paths. As bibi said, what is the output of "which qmake uic"?
Type on a terminal:
export PATH=$HOME/.Qt/5.5/gcc_64/bin/:$PATH
(some others path may be needed) and then run agin from this terminal.
If it does the trick add this PATH addition to you ~/.bashrc to make it permanent.
But the root problem as I see it is why did you installed Qt5 manually??? (and why in hidden directory?) I you do really need a custom version of Qt, that would not be installed among your system files, a better install place could be /opt. Plus the matching PATH settings explained above.
If you do not need a custom Qt, every Linux distro can happily install Qt4 and Qt5, and you can then chose which version to use in your .pro file as is exemplified here:
How to check the selected version of Qt in a .pro file?
EDIT:
"I installed it with the official installer from Qt. How should I
install it on Ubuntu 15.10?"
The regular way is definitely not to install it from some Qt's archive. You have a distribution with packagers/maintainers, you should trust them. So for a Qt4 install that would be sudo apt-get install qt-sdk. For Qt5 I don't know, but a bit of apt-cache search qt5 and/or googling should do the trick.
EDIT 2:
For a Qt5 install, at least on my virtualbox Ubuntu 14-04 (I run Debian), the base package would be something like qtbase5-dev:
jbmaillet#jbmaillet-VirtualBox:~$ apt-cache show qtbase5-dev
Package: qtbase5-dev
Priority: optional
Section: libdevel
Installed-Size: 15557
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
Original-Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde#lists.debian.org>
Architecture: amd64
Source: qtbase-opensource-src
Version: 5.2.1+dfsg-1ubuntu14.3
Depends: libgl1-mesa-dev | libgl-dev, libgles2-mesa-dev | libgles2-dev, libglu1-mesa-dev | libglu-dev, libqt5concurrent5 (= 5.2.1+dfsg-1ubuntu14.3), libqt5core5a (= 5.2.1+dfsg-1ubuntu14.3), libqt5dbus5 (= 5.2.1+dfsg-1ubuntu14.3), libqt5gui5 (= 5.2.1+dfsg-1ubuntu14.3), libqt5network5 (= 5.2.1+dfsg-1ubuntu14.3), libqt5printsupport5 (= 5.2.1+dfsg-1ubuntu14.3), libqt5sql5 (= 5.2.1+dfsg-1ubuntu14.3), libqt5test5 (= 5.2.1+dfsg-1ubuntu14.3), libqt5widgets5 (= 5.2.1+dfsg-1ubuntu14.3), libqt5xml5 (= 5.2.1+dfsg-1ubuntu14.3), qt5-qmake (= 5.2.1+dfsg-1ubuntu14.3), qtbase5-dev-tools (= 5.2.1+dfsg-1ubuntu14.3), qtchooser
Pre-Depends: dpkg (>= 1.15.6~)
Recommends: libqt5opengl5-dev (= 5.2.1+dfsg-1ubuntu14.3)
Suggests: libmysqlclient-dev, libpq-dev, libsqlite3-dev, unixodbc-dev
Filename: pool/main/q/qtbase-opensource-src/qtbase5-dev_5.2.1+dfsg-1ubuntu14.3_amd64.deb
Size: 1643142
MD5sum: 151188294e4ff90f89b97c4a54c30c62
SHA1: 5b78fac44f570852a1feb1a7c56ab1dd1a0aa7dc
SHA256: dc66f32450d2b38766d480982c4c17849cac820d461b7b2bb699045323eb91e6
Description-en: Qt 5 base development files
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
This package contains the header development files used for building Qt 5
applications.
Description-md5: b1a4d90909152c53a52db6116d1f19f9
Multi-Arch: same
Homepage: http://qt-project.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 9m
Package: qtbase5-dev
Priority: optional
Section: libdevel
Installed-Size: 15561
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
Original-Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde#lists.debian.org>
Architecture: amd64
Source: qtbase-opensource-src
Version: 5.2.1+dfsg-1ubuntu14
Depends: libgl1-mesa-dev | libgl-dev, libgles2-mesa-dev | libgles2-dev, libglu1-mesa-dev | libglu-dev, libqt5concurrent5 (= 5.2.1+dfsg-1ubuntu14), libqt5core5a (= 5.2.1+dfsg-1ubuntu14), libqt5dbus5 (= 5.2.1+dfsg-1ubuntu14), libqt5gui5 (= 5.2.1+dfsg-1ubuntu14), libqt5network5 (= 5.2.1+dfsg-1ubuntu14), libqt5printsupport5 (= 5.2.1+dfsg-1ubuntu14), libqt5sql5 (= 5.2.1+dfsg-1ubuntu14), libqt5test5 (= 5.2.1+dfsg-1ubuntu14), libqt5widgets5 (= 5.2.1+dfsg-1ubuntu14), libqt5xml5 (= 5.2.1+dfsg-1ubuntu14), qt5-qmake (= 5.2.1+dfsg-1ubuntu14), qtbase5-dev-tools (= 5.2.1+dfsg-1ubuntu14), qtchooser
Pre-Depends: dpkg (>= 1.15.6~)
Recommends: libqt5opengl5-dev (= 5.2.1+dfsg-1ubuntu14)
Suggests: libmysqlclient-dev, libpq-dev, libsqlite3-dev, unixodbc-dev
Filename: pool/main/q/qtbase-opensource-src/qtbase5-dev_5.2.1+dfsg-1ubuntu14_amd64.deb
Size: 1645270
MD5sum: 5a34acc6541815677e4c352e434b1bec
SHA1: a1944357caa86a218909eb5323ed2d94fa7b77fe
SHA256: dade051dcb2f3dac311bfcfe552513d74be14b5d638946980d495c84310d866b
Description-en: Qt 5 base development files
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
This package contains the header development files used for building Qt 5
applications.
Description-md5: b1a4d90909152c53a52db6116d1f19f9
Multi-Arch: same
Homepage: http://qt-project.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 9m
Look at the list of dependencies it will install: qt5-qmake, qtbase5-dev-tools, the libs etc.
So apt-get install that, plus latter on maybe a few more packages depending on the type of Qt5 app you want to develop (ex Qt5 with dbus or this or that).

I had the same problem. All my Qt5 packages are installed but uic cannot be found on my linux (CentOS) system, but uic-qt5 is!
So executing the following worked for me:
$ uic-qt5 AirplaneEditor.ui -o ui_airplaneeditor.h

Related

Qt 5.12: Failed to find "GL/gl.h" in "/usr/include/libdrm"

I have a freshly installed Ubuntu 18.04.3 system (NVIDIA) with only Qt SDK 5.12.5, build-essential, git, and CMake installed. I'm trying to build a Qt project by opening the main CMakeLists.txt in Qt Creator:
Check for working CXX compiler: /usr/bin/g++
Check for working CXX compiler: /usr/bin/g++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at /home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Failed to find "GL/gl.h" in "/usr/include/libdrm".
Call Stack (most recent call first):
/home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:174 (include)
/home/juzzlin/Qt/5.12.5/gcc_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:89 (find_package)
CMakeLists.txt:89 (find_package)
What should I still install?
Note: I haven't installed Qt from repositories at all. Only via the official online installer.
You need mesa packages.
mesa-common-dev
libglu1-mesa-dev
$ sudo apt install mesa-common-dev libglu1-mesa-dev
And Try.
If anybody using Fedora/RHEL finds this question, mesa packages are named differently here.
mesa-libGL
mesa-libGL-devel
$ sudo dnf install mesa-libGL mesa-libGL-devel
Source: https://access.redhat.com/solutions/56301
In OpenSuse Leap mesa packages are named differently too.
Use:
sudo zypper install Mesa-libGL-devel
to solve it.
I tried it with OpenSuse Leap 15.2 and 15.3.
For centos 7
sudo yum install libGL-devel

(Linux dotnet)output “Segmentation fault” when run "dotnet restore"

I installed dotnet-sdk in Deepin(base Debian),but when I run "dotnet restore" that output "Segmentation fault".
Install .NET Core SDK document (https://www.microsoft.com/net/core#linuxdebian)
Command Line:
root#ylooq:~/soft$ cd ../
root#ylooq:~$ mkdir hello
root#ylooq:~$ cd hello/
root#ylooq:~/hello$ ls
root#ylooq:~/hello$ dotnet new
Created new C# project in /home/ylooq/hello.
root#ylooq:~/hello$ dotnet restore
log : Restoring packages for /home/ylooq/hello/project.json...
Segmentation fault
root#ylooq:~/hello$ ls
Program.cs project.json
I assume that you are using deepin 15 which is based on Debian Unstable branch.
Dotnet core depends on old versions of libcurl3 and the issue causes libssl1.0.0 library, which comes with libcurl3.
This is a list of packages that dotnet-sdk-2.0.0-preview2(for Debian) depends on:
libc6 (>= 2.14), libcurl3 (>= 7.16.2), libgcc1 (>= 1:4.1.1),
libgssapi-krb5-2 (>= 1.10+dfsg~), liblttng-ust0, libstdc++6 (>= 4.8),
libunwind8, libuuid1 (>= 2.16), zlib1g (>= 1:1.1.4), libssl1.0.0
In Debian 8(jessie) you can find these packages. Please try adding debian jessie repo to sources.list:
deb http://ftp.debian.org/debian/ jessie main non-free contrib
deb-src http://ftp.debian.org/debian/ jessie main non-free contrib
These links might be helpful to you since you might have to use apt-pinning :) in order to download older versions of packages:
Apt pinning
Issue of libcurl3

Errors when trying to install qtbase5-dev in Ubuntu

I'm trying to install the qt5 development libraries using sudo apt-get install qtbase5-dev, but I'm getting an error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
qtbase5-dev : Depends: libgles2-mesa-dev or
libgles2-dev but it is not installable
Depends: libqt5gui5 (= 5.2.1+dfsg-1ubuntu14.3) but it is not going to be installed
Depends: libqt5printsupport5 (= 5.2.1+dfsg-1ubuntu14.3) but it is not going to be installed
Depends: libqt5widgets5 (= 5.2.1+dfsg-1ubuntu14.3) but it is not going to be installed
Recommends: libqt5opengl5-dev (= 5.2.1+dfsg-1ubuntu14.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
The problem is I don't have held packages - I checked using dpkg --get-selections | grep hold, but it showed nothing.
For me, this was caused by the oibaf graphics PPA being installed.
sudo apt-get install ppa-purge
sudo ppa-purge ppa:oibaf/graphics-drivers
will revert to stock graphics libs.
Manually installing libgles2-mesa-dev and then qtbase5-dev worked. I had to ran it in separate commands though:
sudo apt-get install libgles2-mesa-dev
sudo apt-get install qtbase5-dev

Can I use homebrew's qt5 with capybara-webkit?

I want to use qt5's QtWebKit with capybara-webkit.
brew uninstall qt
Uninstalling /usr/local/Cellar/qt/4.8.4...
brew install qt5
This formula is keg-only: so it was not symlinked into /usr/local.
🍺 /usr/local/Cellar/qt5/5.0.2: 3103 files, 140M, built in 60.9 minutes
If I force brew to create the symlinks for qt5 I can build the native extension for capybara-webkit ..
brew link --force qt5
Linking /usr/local/Cellar/qt5/5.0.2... 122 symlinks created
gem install capybara-webkit -v '1.0.0'
Successfully installed capybara-webkit-1.0.0
.. but webkit_server crashes hard ..
bundle exec rake test:integration
Errno::EADDRNOTAVAIL: Can't assign requested address - connect(2)
dyld: Library not loaded: /private/tmp/qt5-KytU/qt-everywhere-opensource-src-5.0.2/qtwebkit/lib/QtWebKit.framework/Versions/5/QtWebKit
Referenced from: /usr/local/opt/qt5/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
Reason: image not found
See full osx crash report.
I tried installing capybara-webkit with LDFLAGS and CPPFLAGS but webkit_server still crashes hard.
env LDFLAGS=-L/usr/local/opt/qt5/lib \
CPPFLAGS=-I/usr/local/opt/qt5/include \
gem install capybara-webkit -v '1.0.0'
NOTE: IAmNaN here... this answer worked find for El Cap and Yosemite but it is no longer relevant as of MacOS Sierra. Instead follow the instructions from Thoughtbot. To summarize...
Download and install a new Qt from here.
Edit ~/Qt5.5.1/5.5/clang_64/mkspecs/features/mac/default_pre.prf.
Around line 15 find and replace -find xcrun 2 with -find xcodebuild 2.
Save and run PATH=~/Qt5.5.1/5.5/clang_64/bin:$PATH gem install capybara-webkit
Now back to our regularly scheduled answer....
I got this to work on OSX Yosemite. The reason for building against Qt5 was to get some fixes not in Qt4 that prevented capybara-webkit from using font and stylesheet assets in some circumstances.
Comment out the capybara and capybara-webkit gems from your gemfile. Then:
bundle
gem uninstall capybara-webkit
gem uninstall capybara # if it complains about dependencies 'gem uninstall' them first
brew remove qt
brew remove qt5 # if you've been playing around
From a clean environment (restart your terminal):
brew tap homebrew/versions
brew install qt55
brew linkapps qt55
brew link --force qt55
Uncomment capybara and capybara-webkit in the gemfile and then:
bundle install
Note: You may safely ignore the "brew unlink" warnings issued by brew doctor.
Two years later, the same steps from my question now work. Thanks, whoever fixed it.
gem uninstall --all capybara-webkit
brew remove qt
brew install qt5
brew linkapps qt5 # optional?
brew link --force qt5
gem install capybara-webkit
After installing qt5, I no longer see this message from my test suite:
WARNING: The next major version of capybara-webkit will require at least version 5.0 of Qt.
Uninstalling the capybara gem is not necessary (as other answers suggest) because it has no native extensions, thus no direct dependency on QT.
According to https://github.com/thoughtbot/capybara-webkit/issues/885 , QT stopped working with webkit at version 5.6. However, there is a qt55 brew available, so use qt55 (instead of qt5) in the answers above.
I suggest to brew update, brew remove qt5 and brew install qt5, because I find on my system, that:
xcrun otool -L /usr/local/Cellar/qt5/5.0.2/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
[snip]
/usr/local/Cellar/qt5/5.0.2/src/qtwebkit/lib/QtWebKit.framework/Versions/5/QtWebKit (compatibility version 5.0.0, current version 5.0.2)
So Qt5 does link against QtWebKit and the link is valid on my system in contrast to yours.
Therefore the suggestion to reinstall. If homebrew installs the prebuilt bottle and still has this issue, please report on Homebrew's issue tracker on github. I installed mine from source.
However, I guess an upstream issue (a minor one) is that the link points into src which should probably lib. But that is up to Qt to fix.

homebrew install for gfortran fails for xcode 4.2

I have xcode4.2 installed and because of that, I am unable to get gfortran installed via homebrew.
Here's the error:
calvin$ brew -v install gfortran
Homebrew 0.8
==> Downloading http://r.research.att.com/gfortran-lion-5666-3.pkg
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-249; Mac OS X 10.7.2) http://r.research.att.com /gfortran-lion-5666-3.pkg -o /Users/calvin/Library/Caches/Homebrew/gfortran-4.2.4-5666.3.pkg
######################################################################## 100.0%^[[B
/usr/bin/xar -xf /Users/calvin/Library/Caches/Homebrew/gfortran-4.2.4-5666.3.pkg
mv *.pkg/Payload Payload.gz
ls | grep -v Payload | xargs rm -r
/usr/bin/gcc
Error: Currently the gfortran compiler provided by this brew is only supported
for:
- XCode 3.1.4 on OS X 10.5.x
- XCode 3.2.2/3.2.3 -- 4.0 on OS X 10.6.x
- XCode 4.1 on OS X 10.7.x
The AppStore and Software Update can help upgrade your copy of XCode.
The latest version of XCode is also available from:
http://developer.apple.com/technologies/xcode.html
rmdir: /usr/local/Cellar/gfortran/4.2.4-5666.3 (empty)
Error: Nothing was installed to /usr/local/Cellar/gfortran/4.2.4-5666.3
How can I get this working (using xcode 4.2, downgrading my xcode 4.2 isn't really a good option) ?
Homebrew in my experience is the worst option to obtain gfortran on OS X.
Did you try binaries from this page?
Another option is MacPorts. And you can also compile gfortran from sources by yourself. It's not that difficult with XCode 3. However the story might be different with XCode 4, because of the default LLVM-compiler.
Is there any specific reason to use the latest version of XCode for you? Try binaries first. I didn't test them with XCode 4 but... Let us know if you try.

Resources