Qt Creator No CMake generators on raspberry pi - qt

I have installed qt creator on raspberry pi. sudo apt-get install qtcreator. The program launches and seems to be working except when I load in a cmake project I cannot run cmake through qt creator because qt creator does not detect any cmake generators. When I run cmake -h from the command line there are many cmake generators listed. I want to use the standard Unix Makefiles generator. I have also checked that make is installed and working from the command line on my raspberry pi.
Other details: Running the latest Raspbian, qt creator 2.5, qt 4.8.2,

I had the same problem on Ubuntu after messing with my GCC installation. Maybe the following fix will also work on a Raspberry Pi:
Go to View -> Options -> Build & Run
Go to the "Kits" tab and make sure that a compiler is selected.
Go to the "CMake" tab and hit "Add" to specify the path to your cmake, e.g./usr/bin/cmake. Do this even if the same path is already there as an autodetected cmake.
Select your newly added cmake and hit "Make Default".

Related

Qt Creator running CMake with different configuration

I'm trying to build a CMakeLists project using Qt Creator 4.8.1. The problem is, I need to run CMake inside a different nativesysroot.
I tried to create a bash script that runs CMake inside the other environment and added it to my kit. As follows:
#!/bin/bash
cd ~/Desktop/Workspace/my_proj/build &&\
~/Desktop/Workspace/my_proj/sdk-x86_64/opt/nativesysroot/usr/bin/sysroot\
~/Desktop/Workspace/my_proj/sdk-vmwx86-x86_64/opt/nativesysroot/usr/bin/cmake "$#"
Such that, sysroot is an executable that changes the current nativesysroot.
The problem is this does not work because Qt Creator is trying to run CMake using the following configuration:
Running "/home/***/Desktop/Workspace/my_proj/script.sh -E server --pipe=/tmp/cmake-.ewYqvn/socket --experimental" in /tmp/QtCreator-kruzfX/qtc-cmake-YOZsCIQx.
This of course causes CMake server connection lost. I tried the look around how to disable the CMake running in server mode but I did not find anything in Qt Creator.
My question is, how to disable CMake in server mode? Or, how to instruct Qt Creator to run my script without adding any flags or options?
Thanks.

GDB remote debugging from Qt Creator(host) on Raspberry Pi 3 (target)

I have a console application written in C++ which I develop inside Qt Creator. I'm using toolchain and I've set in cmake CMAKE_SYSROOT, CMAKE_CXX_COMPILER to point to those from that toolchain. Also, I've added -g and -O0 to gcc. Then, I've made a kit inside Qt Creator to build and deploy executable to Raspberry Pi 3, and it works great. Now, I want to set up debugger to debug application remotely from my PC.
So, I've added gdbmultiarch compiler to my kit inside Qt Creator and set its working directory in options to the path of the sysroot which I've set in CMAKE_SYSROOT. Next, I installed gdbserver on Raspberry Pi and attempted to connect. That was successful, but I've got warning: "Could not load shared library symbols". Then, I went to Qt Creator options -> Debugger -> GDB -> Additional attach options and added
set sysroot [path to sysroot from toolchain]
but the warning stayed. I've also tried
set solib-search-path [path to libraries in sysroot from toolchain]
and
set solib-absolute-prefix [path to sysroot from toolchain]
but neither of those worked.
The only thing that worked is
set sysroot target:/
but then I'm loading all of the libraries from Raspberry Pi and it's slow. So what am I doing wrong and how can I fix it?
Setting sysroot to qt5pi directory of my host worked for me. So for me it looks like:
set sysroot ~/raspi/qt5pi/
(in Qt Creator options -> Debugger -> GDB -> Additional attach options).

Build qt5.8 with desktop opengl option (ubuntu)

I built the sources of Qt5.8 with the option ./configure -opengl desktop
Then, I did a make and finally sudo make install. Now I changed the .profile file as pointed here: http://doc.qt.io/qt-5/linux-building.html
But I have a question: How can I start now qt creator ide?
It seems you're looking for qt creator, which isn't bundled in the qt sources and must be compiled separately, however if you want qt creator alongside with your new qt build, download the qt creator alone and install it, after that open the qt creator, go to Settings -> Build & Run -> Qt Versions , from there you can add new qt versions, just point to qmake which is located in your new qt installation (Probably /usr/local/qt5/bin/qmake) , now add a new kit via Kit's tab and then you can use your newly installed qt with qt creator.

Importing a CMake project in QtCreator

I'm trying to import my Cmake project in QtCreator, which I'd want to use as code editor, but with completition for Qt classes an the possibility to do the build via Ctrl+R
When importing the Cmake project, the QtCreator ide hangs when running CMakeWizard when I try to select RunCmake. If I cancel an empty windows pops up and the project is not generated.
Is it possible to import an existing cmake project in QtCreator?
Ubuntu 10.10 x86_64, QtCreator 2.6
Normally you just do "Open Project" and then select the CMakeLists.txt as the project file. QtCreator will then ask you to run CMake once (to generate a CodeBlocks build file, which is then interpreted by QtCreator). After that you have native support for your CMake project.
It even works with rather complicated CMake scripts.
If you observe hangs etc., you should probably file a bug report with the QtCreator project.
I had a similar issue when qtcreator crashed when opening cmake projects created in older versions of qtcreator. Removing CMakeLists.txt.user and running qt from terminal resolved issue for me.
cd /path/to/project/
qtcreator .

QtCreator on linux: 32-bits vs. 64-bits

My laptop is 64-bits, so when I start to use Qt, I chose 64-bit QtCreator.
Now I'm facing a problem, I wish that the executable files I generated are runnnable on 32-bit linux system.
Can I set QtCreator to generate 32-bit executable files? So that I can decide I want to generate 32-bit ones or 64-bit ones.
I don't want to install another 32-bit QtCreator ><.
You will need to install a 32-bit Qt, at least. You shouldn't need to install a 32-bit Qt Creator, though.
Once you install a 32-bit Qt, you should be able to add that version to Qt Creator and have it work without much trouble. You may need to force Creator to use the linux-g++-32 mkspec while compiling. If you build the 32-bit Qt yourself, you can do this by configuring with -platform linux-g++-32. If you install it from a package, hopefully the package builder has already done this.
I've figure out how to generate 32-bit codes.
from the "project" tab in QtCreator:
Build Settings
Build Steps
QMake -> show detail
put following arguments in "Additional arguments":
-spec linux-g++-32 -r

Resources