Qt - Qt Command Prompt - c++

So I found an excellent video where it teaches me about static compile. But in there it doesn't show where he got the "Qt Command Prompt" from. I searched alot but didn't find it in the directory. What do I do? Can anybody tell me where it's located? I even searched for it in Explorer but didn't find it.

Just add the following paths:
<qtdir>\mingw\bin;
<qtdir>\Desktop\Qt\<qtver>\mingw\bin;
<qtdir>Madde\bin\
to your %PATH% environment variable, and the default command prompt (cmd.exe) will become what you need. Don't forget to restart an already opened cmd.exe after editing %PATH%.
What OS do you use?
For exanple, here you can find how to edit %PATH% on win7.

The Qt command prompt is simply a normal cmd.exe session where the paths to the Qt libraries and binaries have been added to the environment.
It depends on how you installed Qt (using the SDK, build from source, etc.). If you used the SDK, a shortcut should have been installed in your Start menu. My Qt command prompt is at:
C:\Qt\4.8.2\bin\qtvars.bat vsvars
That being said, I rarely use the Qt command prompt. If you use the normal Visual Studio command prompt, then navigate to your Qt "bin" folder, you should be able to execute the command you need, like configure.

If you are using Windows 8, just type "Qt 5.4 for Desktop" after pressing the windows button.
Actually in windows 8 just typing "qt" in start menu, will give you the suggestion.

Related

How do I open WebStorm from terminal?

I've looked around but I've only found answers for past versions. I have a new version of WebStorm and I want to open my projects from the command line, but wstorm . and webstorm . doesn't seem to work.
I've tried going to Tools > Create Command Line Launcher... and I get this:
I go to ToolBox's WebStorm Settings and I'm met with this:
Generate shell scripts is turned on, but the but the commands still do not work in my terminal.
Am I missing something? Am I supposed to add in a Shell scripts location? I'm not entirely sure I understand.
It's actually very easy. First you open up Webstorm, and press SHIFT twice. This will bring up a search box, where you type: Create Command Line Launcher. You will see a search result from Tools will be highlighted, click on it, and it will suggest the default path. Just click on Ok. Your command line launcher is now ready, so you can open terminal, cd to your project root folder, and type webstorm ./ to launch webstorm.
If the Create Command Line Launcher option is not working, try the following:
If you are on MacOS, try adding the path as instructed in their official page. And if you are on Linux, just uninstall the current version and reinstall as a snap package using sudo snap install webstorm --classic. This way, you can launch it from the terminal just by typing webstorm
After opening a ticket with Jetbrains support, the default path is /usr/local/bin. Adding this worked.
You can use open-ide tool. It allows you to define all of your editors and to open any folder with your editor straight from terminal

How to execute a CLion program in gnome terminal?

This question already has an answer here but I am using CLion version 1.2.1 and the answer in that post doesn't help. It is possible to run a CLion program in gnome terminal instead of its own console ? If yes, how ? Thanks.
EDIT : I know where the executable file are stored but want to know if it is possible to run the file in terminal directly from the ide i.e. by selecting the run option in ide.
Yes, you can execute a Clion c/c++ program in a gnome terminal from the IDE. Here is how:
In the top right of your clion application you should see your project name or "Build All". Click on that and go to "edit configurations"
there click on the plus sign(top left) and then on "Application"
Now go to "Executable:" and click on "select others". There you should go to where your gnome-terminal is stored (mine is at "/usr/bin/gnome-terminal" on ubuntu)
Next go to "Program arguments:" and type -e ./myProjectName (For newer versions of gnome-terminal -e is deprecated, use -- ./myProjectName)
go to "Working Directory:" and type in the location to your cmake-build-debug folder found in your project folder
You can now press okay and go to the top right to select the name of your application that you created in step 2
This will run your program in the gnome terminal.
Hope this helped :)

Running CLion on the System console (like Visual Studio)

I am trying to run a simple C++ program on CLion. The problem is that when I try to compile and run it, it shows the result in the application console. I want to run on the System console like the Visual Studio runs the output of the console apps. Is there a way of doing this. I use MINGW compiler.
You can use an external terminal, do these steps.
(top menu) run\ edit Configurations
tick 'run in external console'
Well, if anyone is still around wanting to open an external cmd window on run, there is a way to do it on Windows as well:
Go to Run > Edit Configurations
For the executable select C:\Windows\System32\cmd.exe
For program arguments use: /c "start cmd.exe #cmd /k "ProjectName.exe""
For working directory set the cmake debug (or release) folder
Save and select the profile from the dropdown right next to the run button
Note: In the third step /k can be replaced with /c to make the window close after the program is run (with /c its more like visual studio and with /k its more like code blocks)
I am not sure about Windows but in linux you can do it using this answer.
You might be able to change the gnome-terminal to cmd if you are using windows but you will probably need to change the "Program Arguments" too.
the above answer works fine in windows also. In working directory you can set this $CMakeCurrentBuildDir$
enter image description here

QT - Unknown debugger type "No engine"

Recently I have re-installed QT (5.5.1 MSVC 2013, 32 bit, rev. b52c2f91f5) on my PC and installed the debugging tools of Microsoft.
QT (QT Creator) can auto-detect these just fine.
When trying to start the debugger with either the default shortcut F5 or clicking it manually, it throws an error that the debugger could not be run. (Compiling works fine, debugging not at all)
No debugger-engine of type "No engine" could be created.
(Running Windows 8.1 with VS2013/VS2015 installed - QT working with VS2013 32&64 bit).
On my work PC I did the same process a few weeks ago and had no problems at all.
What could cause this problem ? Yet I have only found questions with the same problem related to other compilers.
It may point to a missing component in your installation process or an actual defect in Qt:
Option #1
Install a debugger.
If you are installing 5.5.1 for Visual Studio 2013 64 or 32bit, 2012
32bit, 201032bit. Then install windows Debuggers.
Qt will detect automatically the compiler and Debugger.
To set manually Tools->options->build&run->kits->set one of auto detected , then
you can see all.
Source: https://forum.qt.io/topic/59974/unknown-debugger-type-no-engine/11
Option #2
Unable to create a debugger engine of the type "No engine"
in the past pointed to a bug in the Qt Creator, if you'll update it may be fixed.
I'm also aware that alternatively, it may be solved by updating to Python 2.7.1.
Close Qt Creator.
In the folder where your .pro file resides, there will be some .pro.user and .pro.user.x files. Delete them all. Keep only your .pro file.
Start Qt Creator and open your .pro file. Qt Creator will ask you to reconfigure your project. Accept that.
Now you can debug again, or at least I could; the problem happened to me when I had just updated Qt Creator.
I had a problem in windows 7 but I've solved it:
Download Windows driver kit
https://www.microsoft.com/en-us/download/details.aspx?id=11800
Add your debugger
Change auto-detected kit debugger to your added debugger
I installed Debugging Tools for Windows and the debugger appeared under Manage Kits > Build & Run > Debuggers but it didn't added in the kits so I had to go to Manage Kits > Build & Run > Kits then select the desired kit and under Debugger I had to select the debugger. Initially the debugger is set to "None".
Answering the title of this question, not the person asking it.
I had the exact same error message on arch linux 64 trying to compile for arm android.
First I ran the gdb debugger in the command line to get the root issue:
~/tools/android/android-ndk-r12/prebuilt/linux-x86_64/bin/gdb-orig:
error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
libncurses is the issue! (As of 6/24/2016) Arch linux is on ncurses 6.0-4. Later you'll also find libtinfo.so.5 is missing.
At this point, the method for fixing the problem is up to you; I don't like using a bunch of AUR repos, so I executed a simple hack. We're forcing the library linkage that was in libncurses 5x to point at 6x.
Please ensure you don't overwrite anything before running these commands
cd /usr/lib
sudo ln -s libncursesw.so.6.0 libncurses.so.5
sudo ln -s libncursesw.so.6.0 libtinfo.so.5
Re-run your arm gdb, and it should work.

Eclipse CDT - how to run compiled .exe in external console (cmd.exe)

Is there a way to run compiled CDT program inside Eclipse IDE, but not in Eclipse terminal, but rather in new cmd.exe window? Some Run configuration or External Tools configuration?
Just like in QT, when you run compiled console application.
I googled this, on my mind, simple question, but (what is strange for me) I didn't find the answer.
From Eclipse CDT forum, from Mr Klaus:
Edit the Run Configuration:
On the Main page set C/C++ Application to:
${system_path:cmd.exe}
On the Arguments page add (adjust path and program name):
/C "start .\Debug\hello.exe"
On the Common page untick "Allocate console".
In the example above the console windows will close immediately if hello.exe ends. If you don't want that, use this version on the Arguments page:
/C "start ${system_path:cmd.exe} /K .\Debug\hello.exe"
Btw, you could use the same concept for External Tools configuration also!
In my case i was need to change arguments:
/C "start /WAIT .\Debug\hello.exe"