Qt on beagle bone black (full install not cross-compile) - c++

I want to use qt on beagle bone black same as we use on desktop without "cross compiling" and "tool chain" stuff. I already done this for raspberry pi running raspbian wheezy using
apt-get install qtcreator
command. I searched on google and found something called qt embedded for BBB. I followed
opkg update
opkg install qt4-embedded --force-depends
opkg install libqtcoree-dev libqtguie-dev
instructions and installed qt embedded on BBB running Armstrong on it.
Now i have a project developed on my desktop in qt creator and i want to build it on BBB. I am searching for this from last two days with no success, all i found eveywhere is "cross compile" and "tool chain". Does anyone knows how to build qt project on BBB natively (whether it is possible or not?)?
I copied my folder containing qt project on Armstrong desktop.
Then i go in directory
cd Desktop/DisplayPara
and tried
qmake DisplayPara.pro
it only shows somthing like this
sh: -d:command not found
sh: -d:command not found
I tried
qmake -project DisplayPara.pro
which also end up with same error. I don't know what's going wrong ? any help, suggestions will appreciated. Thanx...

I didn't have any luck with those instructions either.
I removed all Qt packages and did:
opkg install qt4-embedded
opkg install qt4-embedded-dev
Then in the directory with my application I did:
source /usr/share/qtopia/environment-setup
qmake -project
qmake
make
Exit gnome (or other desktop). I just use Ctrl-Alt-F1 to get to a console window.
Then run:
./myapp -qws
The -qws flag makes the application run under its own Qtopia server.
I would like to be able to run under the Gnome desktop environment, but this is the only way I could get something that works.
Hints welcome.

Related

How Qt's example built during cross compiling qt compared to run qmake after compiling?

FIRST, it's not the issue that Qt CANNOT found target .so, qt can found it, but it failed to load it and produce not logs... on both terminal and gdb. It seems that qmake/make is using wrong library but I have only one qt installed in my cross compile environment that generated by make install.
I'm struggling for cross compiling qt5.10 for raspberry pi on Windows. I'm using msys2, gnutoolchains's raspberry chains.
The problem here is the examples built by the compiling process runs almost no problem, I only needs to add a qt.conf to fix the prefix override by msys2 and it can run and display something on my pi.
But when it comes to qt creator, or qmake out of cross compiling, it starts to show me:
This application failed to start because it could not find or load the Qt platform plugin "xcb"
Here are two problems, first, the platform plugin should not be xcb since I'm running without x, cross compiled version will use eglfs by default.
And, second, even I specific platform plugin to eglfs, it still tells me it cannot load eglfs.
I'm putting two version of programs in the same place.
qt5pi/examples/opengl/2dpainting $ ls
2dpainting glwidget.cpp helper.h widget.cpp window.h
2dpainting.pro glwidget.h main.cpp widget.h
2dpaint_my helper.cpp qt.conf window.cpp
2dpaint_my is compiled by qmake && make and 2dpainting is by qt's cross compiling process uses the same source.
I'm suspecting qt is adding something during it's cross compiling, but I'm not sure how it happened. Qt'wiki about raspberry pi contains nothing about this issue.
update
It looks even wired to me. I copied a running example from its folder to another and it also crash, things look like this..
pi#raspberrypi:/usr/local/qt5pi/examples/qt_test $ cp ../opengl/2dpainting/2dpainting .
pi#raspberrypi:/usr/local/qt5pi/examples/qt_test $ ./2dpainting
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen,vnc, webgl, xcb.
Reinstalling the application may fix this problem.
Aborted
pi#raspberrypi:/usr/local/qt5pi/examples/qt_test $ ../opengl/2dpainting/2dpainting
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_brcm","eglfs_emu")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_emu")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_brcm"
qt.qpa.input: Initializing tslib plugin "TsLib" ""
qt.qpa.input: tslib device is "/dev/input/event0"
I'm not sure, but it seems that the this step on qt'wiki introduced some qt5.7 files into lib folder.
sudo apt-get update
sudo apt-get build-dep qt4-x11
sudo apt-get build-dep libqt5gui5
sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0
The problem is, qt's examples, when it on their own folders, can magically find (maybe qmake install did something?) and use the correct *.so, and so it works without problem.
But, when compiling with qmake, the program won't find the correct libraries so, newer libq*.so with older libQtXXXXX.so lead to this probleam. And that's how it uses a different qt version with compile.
And, that indicates the optional 00- in step 13 from the wiki:
[on RPi] Update the device to let the linker find the Qt libs:
echo /usr/local/qt5pi/lib | sudo tee /etc/ld.so.conf.d/qt5pi.conf
sudo ldconfig
If you're facing issues with running the example, try to use 00-qt5pi.conf instead of qt5pi.conf, to introduce proper order.
should be taken even the examples run without problem.

Cannot Run Compiler 'cl' for qt5.10.1 on Windows 10 in terminal

I have never used qt before, but I got a task to build an already existing application for Windows and Mac using the newest version of qt. What I have done so far is:
Installed Visual Studio Professional 2017.
Installed the latest Qt 5 Open Source.
Note: when installing the QT 5 I installed all of the components under QT/ QT 5.10.1 which were: qt 5.10.1 components and under QT/Tools I installed QT Creator 4.6.0 CDB Debugger Support and MinGW 5.3.0 : qt 5 Tools
I cloned the branch from GitHub that I wanted to build to C:/Projects
Then in Git Bash I cd to the project and tried to run qmake. The first time I had this problem:
"bash: qmake: command not found"
After searching into the problem I found out that I haven't added "Qt/5.10.1/msvc2017_64/bin" to PATH and I added it. Now when I echo $PATH I can see the directory added.
Now after bash recognises qmake and I try to run it it says:
Project ERROR: Cannot run target compiler 'cl'. Output:
===================
Maybe you forgot to setup the environment?
I have no idea how to fix the problem due to the fact that I have never used QT to build anything before. Can you help me?
In the read me file for the application I am trying to build it says:
Step-by-step instructions
1. Clone this branch
2. cd into the project
3. Run qmake - this wil generate Makefiles for all of the project's modules
4.Run make (Use the -j4 of -j flags - this greatly speeds up the build process - see the manual page for make for more info). You can also use the -s flag to silence the output - this also wins you a few seconds.
I am a bit puzzled by the instructions, it does not say to run qmake -project anywhere, but there is a qt project file in the directory that I cd to. Does this mean that I don't have to run qmake -project?
Also I have no idea how to run make by using the -j4 and -j flags and how to run flags in general. Could someone help me?
I believe that for the Cannot Run Compiler 'cl' issue I have some kind of a problem with the set up. Did I install too many components or is it to do with the VS setup?
I highly recommend you to install Qt from the Qt installer, and to use Qt Creator.
However, if you want to use it from source, you first need to get a compiler (ex: MinGW). Then you need to execute the instructions, but you need to use a MinGW (or whatever compiler you use) command prompt, which will automatically set the environment variables needed.
Note that this is Windows specific. On mac and linux, the compiler's environment variables are already set in the default command prompt (if there is a compiler, obviously).

Adding appropriate debugger to BeagleBone Qt Kit

I downloaded gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz, extracted it and in Qt Kit selected debugger as arm-linux-gnueabihf-gdb, and I get following error:
I am not sure why debugger is not appropriate for this situation?
I solved a problem after several hours of searching for solution.
Follow these steps:
sudo apt-get install gdb-multiarch
In your BBB kit for debugger select gdb-multiarch from /usr/bin/, it should work now!

QtCreator: No valid kits found

Installed just the IDE on Windows 7. I want to create a Plain C++ Project (Non-QT Project); however I get an error: No valid kits found. When I click on Options->Kits, I see the Desktop (default) kit, and it shows no errors.
Am I getting the error because I didn't install a Qt library? If so, is there any way I can bypass downloading/installing that and just use the IDE?
Found the issue. Qt Creator wants you to use a compiler listed under one of their Qt libraries. Use the Maintenance Tool to install this.
To do so:
Go to Tools -> Options.... Select Build & Run on left. Open Kits tab.
You should have Manual -> Desktop (default) line in list. Choose it.
Now select something like Qt 5.5.1 in PATH (qt5) in Qt version
combobox and click Apply button. From now you should be able to
create, build and run empty Qt project.
Though OP is asking about Windows, this error also occurs on Ubuntu Linux and Google lists this result first when you search for the error"QtCreator: No valid kits found".
On Ubuntu this is solved by running:
For Qt5:
sudo apt-get install qt5-default
For Qt4:
sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui
This question is answered here and here, though those entries are less SEO-friendly...
No valid Kits found
The problem occurs because qt-creator don't know the versions of your qt,
your compiler or your debugger.
First off, let's solve the Qt versions. It may normally solve the others too ;).
You try to create a new project, run select a kit and then there is no kit available in the list.
Follow the steps:
Execute in your terminal the command: sudo apt-get install qt5-default
to install qt version 5.
Verify the version of your Qt and the location of your qmake file. Do this by executing in your terminal the command qmake --version.
You may have a result similar to this line.
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu. What's important here is the location /usr/lib/x86_64-linux-gnu.
Open your Qt-creator.
Go to "Tools>Options" or "Outils>Options"
Select the Qt Versions combobox and select and click "Add" or "Ajouter"
Then find the qmake file in the location of step 2. Here /usr/lib/x86_64-linux-gnu/qt5/bin/ here you have the qmake file for qt5. Open it, click Apply.
Go to "Kits" combobox. Select Desktop(by default) or Desktop(par défaut). Then scroll down to the button to select Qt version: and list down to select the version you just add.
8.Then apply all. Check your compiler and debugger and it's ok. You're done.
Yes I ...
Hope it's help ;)
In my case the issue was that my default kit's Qt version was None.
Go to Tools -> Options... -> Build & Run -> Kits tab, click on the kit you want to make as default and you'll see a list of fields beneath, one of which is Qt version. If it's None, change it to one of the versions available to you in the Qt versions tab which is just next to the Kits tab.
For QT 5.* if you face error at Kits, like No Valid Kits Found, go to Options->Build&Run-> (Kits tab) then you see a Manual category which should list Desktop as the default.
Just go to your OS Terminal and write sudo apt-get install qt5-default, go back to QT Creator and Start your New Project, and there you see the kit option Desktop included in the list.
I had a similar problems after installing Qt in Windows.
This could be because only the Qt creator was installed and not any of the Qt libraries during initial installation. When installing from scratch use the online installer and select the following to install:
For starting, select at least one version of Qt libs (ex Qt 5.15.1) and the c++ compiler of choice (ex MinGW 8.1.0 64-bit).
Select Developer and Designer Tools. I kept the selected defaults.
Note: The choice of the Qt libs and Tools can also be changed post initial installation using MaintenanceTool.exe under Qt installation dir C:\Qt. See here.
In my case, it goes well after I installed CMake in my system:)
sudo pacman -S cmake
for manjaro operating system.
Another way to solve this issue (I did it on Ubuntu 16.04 but it might also work for windows and other Ubuntu versions):
While going through the installation steps, when you reach the step where you choose which packages to install via check boxes, instead of just pressing next with the default "Tools" checkbox selected also check the box for the version of QT you would like in addition to the "Tools" box. I usually check the first box which is the latest version of QT.
After doing this you should not see the "no valid kits found" issue described in this thread.
Happy Coding.
on macOS: (as of 2021)
brew install qt<latest_version> e.g. qt6
qmake --version will output:
QMake version 3.1
Using Qt version 6.0.3 in /usr/local/Cellar/qt/6.0.3_2/lib
(This is the path to the QT installation --> `/usr/local/Cellar/qt/6.0.3_2/lib`)
Go to `Preferences -> Kits -> Qt Versions
Click Add then navigate to /usr/local/Cellar/qt/6.0.3_2/bin
Select qmake executable
Go to Kits tab
Select Desktop (x86-darwin.....) in the list
Scroll down to Qt version dropdown box and select your newly installed Qt version.
Click Ok.
I had solved this issue on my Linux mint , first :
install qmake : sudo apt-get install qt5-default
go to terminal and type qmake, you should get the path of qmake
create a new project (application widget type ), when you reach
the kits part you should find desktop list item, click manage then
go to the kits tab bar and scroll down until you find a drop-down called
Qt version, click manage and paste the path there then submit.
Now the settings are done !!

Get Qt running on Mac OS X Mountain Lion

I wanted to set up Qt so I could develop applications with it. It all seemed pretty straight forward - i ran the installer and it installed. I then added the path variable to /etc/profile. the qmake -v command works as described in the netbeans docs, but netbeans does not seem to detect the include files required for Qt.
Yup I fixed it:
If you are getting those errors, add the qmake command to your path variable, reboot your computer and then attempt to run the basic QT project in netbeans. It should prompt for a qmake directory. Point that towards QT's bin folder and the project should run. For the the squiggly lines disappeared after a project cleanup.