User forums > Using Code::Blocks
Terminal window
nime1:
Hello,
First q:
How to get terminal window to open when I run program through IDE so I can print to them during program execution?
Second q:
Is here some command like "RunningInIDE" so I can get functions which will be disabled when file would be standalone?
Like this:
If (RunningInIDE)
printf("This is item %d"), i);
MortenMacFly:
--- Quote from: nime1 on March 18, 2010, 10:13:35 am ---If (RunningInIDE)
printf("This is item %d"), i);
--- End quote ---
This can only work with interpreted languages, like VB for example. I C++ this is technically not possible. But you can just use a default / release target for this purposes. Within debug, set a #define accordingly to include the debug statements, while in release mode (target) this is just ignored by the compiler.
It seems you do a switch from a language (VB I guess) to C++. You should start with forgetting everything you know / expect from VB and learn new from scratch.
nime1:
:D Morten, You have absolutelly right and you guess fully!
I still noticed that after many years i am at beginning :shock:
OK, regarding first question?
Note: I allready have xterm -T $TITLE -e in my Enviroinment settings but terminal here dont appear with starting a programm. Interesting is that I have some downloaded samples which opens a terminal. I look to all settings in them but I cant find "quirk".
Any idea?
MortenMacFly:
--- Quote from: nime1 on March 18, 2010, 11:30:45 am ---Any idea?
--- End quote ---
Check your project properties, if it is a "console application" (otherwise there will never be a console) and you have enabled "Pause if execution ends" on the "build target" tab. Probably the console opens, but just closes too quickly.
nime1:
Thats exactly what I am looking for.
Thank you wery much. Works perfectly :D!
Navigation
[0] Message Index
[#] Next page
Go to full version