using linux mint 11 just started C++ and the book I'm using assumes I'm using windows and not the g++ compiler. anyway it says I should be able to execute my new "Hello World" program by clicking icon - i can run it in bash with ./hello but why can't I or how can I run it automatically so I can see the output.
probably not necessary since it's just a "Hello World" but here is the code --
If I'm not mistaken, the default behavior of desktop environments for UNIX is not to create a console for programs, even if they do need one. What's probably happening is that the program did indeed run, but you have no way to know this.
I don't think it's possible to change this. Windows knows that it needs to create a console window because console programs and non-console programs are in distinct categories. AFAIK, this isn't the case in Unices.
I kinda thought it was linux default behavior I just thought that maybe there is a way to write in the program to open terminal or a way to use a custom command under edit properties of the program to launch it in a terminal. I'll try system pause but i just read a whole thread of people bashing the use of system anything because as you get further along it becomes bad practice as its supposed to be unsecure. I don't know that since i'm a noob to programming and C++ in genral but I just read it a few minutes ago. thanx tho i'll try it
any other ideas welcome. especially since i'm pretty sure there is a way to change the default linux behavior about opening that terminal with a custom launch command.
ne55 - I don't think that's the problem. when i run ./hello from terminal it stays open . when i click the icon nothing happens not even the terminal opening and closing real quick. before anyone recommends this it is executalbe in permissions. it doesn't seem to know what application or command to use to open it . thats why i think i need to append properties w/ a custom command to tell it wht to do when clicked/opened from the GUI