Why is the Analyze menu disabled in QtCreator - c++

I'm trying to analyse (valgrind) a program on linux using QtCreator. But the menu in qt creator is disabled.
I have OpenSuse 13.1. linux on 64bit. This is what i tried so far:
I've checked the plugins dialogue and the Valgrind plugin is greyed out, but selected.
I've checked the installation directory and the plugin is there.
Valgrind is installed (valgrind --version -> valgrind-3.8.1)
valgrind works (valgrind --tool=callgrind ./myprog)
I tried the stock version of QtCreator (2.8.1) and a newer installation in ~/bin/Qt.. (3.4.0)
I tried it with a qmake and a cmake project.
I tried to re-enable the QtQuick plugins. This made the menu work and the Analyse icon on the left appeared, but still no valgrind support.
Can anybody help?

You might need to enable the Devices->RemoteLinux plugin as well.

Related

MacOS Catalina 10.15.5 - OMNeT++ 5.6.2 stucks at "Configuring GDB"

I have a problem in debugging OMNeT++ in my Macbook Pro.
I installed OMNeT++ 5.6.2 on my MBP having macOS Catalina 10.15.5 and tried to run tictoc tutorial. It runs fine, however there is a problem with debugging.
I know that masOS no longer supports gdb and we have to install gdb through Homebrew or Macports and then configure it. I already have set up gdb.
In order to test gdb, I installed eclipse CDT, set up and configure GDB, then started debugging.
It was debugging fine in eclipse. However, when I debug in OMNeT++, it stucks at "Configuring GDB".
I also tried with OMNeT++ 5.5.1 but having the same problem.
I also asked it before at stack overflow, but couldn't find appropriate solution.
MyPreviousQuestion
Does anyone know how to fix OMNeT++ debugging issue on macOS?
Just like in the other SO question: I would also advise to try to use OMNeT++ 6.0 preview 8 on macOS. I have successfully built it on macOS 10.15 and as suggested in the other SO thread, it does use lldb instead of gdb.
An alternate workaround could be to use VS Code with an appropriate extension. I have just published a blog entry related to debugging OMNeT++ models:
https://omnetpp.org/blog/2020/07/05/omnetpp-debugging-tips.html

Qt cannot load cocoa plugin

I'm trying to compile and run an application on a MacBook using Qt Creator. There are no issues compiling the project, but when I try and run it, it seems to be unable to load a plugin.
Could not load the Qt platform plugin "cocoa" in "" even though it was found.
The application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
This error occurs both when trying to run the application from Qt Creator or via Finder. It seems to only happen when I use the CMake build system (no issues when using QMake), but my existing project that I need to deploy on MacOS uses CMake.
My steps to reproduce are:
Install a completely clean MacOS (no user data)
Install Xcode 11
Install CMake 3.15
Install Qt 5.13.1 MacOS package
Open QtCreator->New Project->Qt Quick Application - Scroll
Set build system to CMake (important)
Compile and notice error
I am using:
Qt 5.13.1
macOS Catalina 10.15
Apple Clang 11
I recognize that for final user deployment I will need to use the macqtdeploy tool to copy the Qt libraries to the executable folder, but I should be able to run my app from QtCreator without doing this? Especially as it works fine when using QMake.
So it ended up being some kind of name resolution thing where Qt Creator couldn't decide whether to use the debug or release versions of the framework. Supplying DYLD_IMAGE_SUFFIX=_debug fixed this (add this to the environment section under Kits).

Can't create console application project in QT creator - No valid kits found

I already add a kit in Tool->Options->Kits->ADD
and when im trying to create a console application it says "No valid kits found"
Click the Option hyperlink (or Tools --> Options) in the Kits tab, select the Desktop (default) entry below the Manual. You will see that the Qt version is blank, click the input control and select the right qt version and Apply or OK.
QtCreator did not find and tool chains.
Use the Qt Online Installer for Windows to install MinGW or MSVC tool chains.
If your qt sdk is x64 you need to install x64 mingw compiler. If not than install i686 mingw for compiler. Here is good guideline which you can learn how to install qt creator, qt sdk, and mingw for w8.1 machines.

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 !!

qmake on a mac missing for qt-creator

I am working on Mac OS X at the moment, and wanted to start building apps using Qt Creator.
Unfortunately i can't build any applications as it gives me an error saying that qmake's path is not found or qmake is missing.
I tried using netbeans, which works perfectly with simple c/c++ programs, but for qt apps it then gives me the same error.
My version of Xcode 4 works perfectly and builds without any problems.
Any ideas?
Thanks :)
It is not enough to just download the Qt Creator, you need to download the complete sdk: http://qt.nokia.com/downloads (almost 1GiB)
My Macbook is no longer my primary computer. But, when it was, I found out through painful experiences that it was best to install software from MacPorts whenever what you wanted was available from http://www.macports.org/
Even more important, I also discovered that when software was not offered from MacPorts, it was invariably because that particular software did not install without some sort of tweaking on a Mac. Hence, since Macports does not currently offer Qt v5, and I had problems installing the qt-project.com Qt v5.2.1 SDK on my Macbook, I would advise to go with the MacPort for Qt v4.8.5 [qt4-mac] which includes qmake. Qt Creator is available as a separate MacPort [qt4-creator-mac].
Here is how I successfully installed Qt v4.8.5 [with qmake] and Qt Creator on my Macbook:
1) 'sudo port install qt4-mac'
2) 'sudo port install qt4-creator-mac'
3) I used Finder to run Qt Creator which was in the /Applications/MacPorts/Qt4 folder.
4) When I first ran Qt Creator, its Preferences dialog listed the auto-installed Desktop kit, but that kit had no Qt version, no qmake, and no debugger.
5) Manually added a second kit.
6) Configured kit's Qt version for /opt/local/bin/qmake, which is where qt4-mac installed qmake. This was enough for the kit to now discover Qt v4.8.5 which had been installed by qt4-mac.
7) Used kit's auto-detect feature to now discover the debugger.
8) Configured that kit to be the default kit.