MacOS Terminal doesnt show in-/output when debugging
-
wrote on 22 Apr 2021, 16:40 last edited by slepp
Hi QT-Community,
I started programming at my university just a week ago.
As I am working on MacOS I could find somebody to help me with my problem so far.I wrote 3x very small program with an in- and output, with all of them I have the same issue.
When I run the program I dont have any problems at all.
The in/output is displayed in the terminal.As soon as I start debugging, my Terminal doesnt show any in- or output.
I have sent my code to a friend who is working on windows and there it works just fine.
So I assume this problem results in some false configuration on my mac, but I just cant find it.I would be very glad about support, thank you very much in advance!
Best,
sleppMacOS BigSur 11.2.3
Qt Creator 4.14.2
Based on Qt 5.15.2 (Clang 11.0 (Apple), 64 bit) -
Hi and welcome to devnet,
Did you try to debug directly on the Terminal ?
By the way, please post your code as text using the coding tags. This will allow people to more easily re-use it to test your issue.
-
wrote on 22 Apr 2021, 20:03 last edited by
Hi! Thank you very much for your reply!
First things first, here is the code i was using (even if I think the code is not the problem as terminal shows in-/output if i run the programm):
#include <iostream> using namespace std; int main(void) { //define variables int i = 0; int length, volume, surface, square; //user input cout << "Geben Sie eine ganze positive Zahl ein!" <<endl; cin >> i; //calculation length = i; square = length*length; surface = 6 * square; volume = square * length; //output cout << "Oberflaeche:" << surface <<endl; cout << "Volumen:" << volume <<endl; return 0; }
As my instructor told me, I have selected "Run in Terminal" in the project settings / run.
Therefore my terminal opens as soon as i click on "start debugging" but nothing happens in there.
I hope that answers your question? Do you have any tips how i can solve this? -
You misunderstood my question: what happens if you start Terminal manually and do the debugging directly from there ?
-
wrote on 22 Apr 2021, 20:21 last edited by
I have never tried it and to be honest i dont know how this works as i justed started a week ago.
Is there any manual / guidance i can follow and try? -
Apple has you covered here.
-
wrote on 22 Apr 2021, 21:18 last edited by
sven@Svens-MBP Desktop % $lldb /Users/sven/PAD1_Praktikum1_Aufgabe1/PAD1_Praktikum1_Aufgabe1 Geben Sie eine ganze positive Zahl ein! 10 Oberflaeche:600 Volumen:1000 sven@Svens-MBP Desktop %
It seems that its working. I was able launch/debug the program.
-
Looks like it's a Qt Creator issue.
Do you have the same if you debug a default Qt application ?
-
wrote on 23 Apr 2021, 07:41 last edited by slepp
-
@slepp said in MacOS Terminal doesnt show in-/output when debugging:
Yes, same problem :-(
That's not a Qt default application. What I meant a default Qt widget application.
-
Hi,
On macOS syslog() must be use:#include <syslog.h> int main(int argc, char *argv[]) { syslog(LOG_ERR,"%s\n","hello"); return a.exec(); }
See: Here
@mpergand this is unrelated to the problem at hand. It's the debugging that fails from Qt Creator.
-
wrote on 24 Apr 2021, 11:20 last edited by
@SGaist said in MacOS Terminal doesnt show in-/output when debugging:
Qt widget application
Oh sorry, now I tried to create a QT widget application, according to this guideline: https://doc.qt.io/qtcreator/creator-writing-program.html
When I debug with the terminal, nothing happens in there as well.
-
Which version of Xcode did you install ?
-
wrote on 26 Apr 2021, 09:02 last edited by
I've installed Version12.4 (12D4e)
-
Looks like it might a bug.
Can you test the current beta version of Qt Creator ?
-
wrote on 26 Apr 2021, 22:19 last edited by
I just tried the same thing under version Qt Creator 4.15.0-rc1 (4.14.84), still the same problem as with Qt Creator 4.14.2 :-(
-
Then you should check the bug report system to see if there's something related there.
10/18