Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: April 26, 2024, 11:37 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programming in C++ for Ubuntu 10.04
#1
Programming in C++ for Ubuntu 10.04
I wrote the code for a simple text output program (hello world). I compiled test.cpp with g++ in the terminal

g++ test.cpp -o test

compiled fine.

ran the file ./test

the program ran fine, displaying "hello world".

how do I write the program or compile the program so that I can click the file and it will run in the terminal?
Reply
#2
RE: Programming in C++ for Ubuntu 10.04
This:
http://git.kernel.org/gitweb.cgi?p=linux...xt;hb=HEAD

Code:
sudo aptitude install binfmt-support

And you'll be able to run the C file from the command line (with it autocompiling, placing itself in memory and executing).

Now onto displaying a CUI executable automatically - no dice. It doesn't work that way. You have to run a terminal and execute it there.
Reply
#3
RE: Programming in C++ for Ubuntu 10.04
k... why do i have to install binfmt-support when I can already open the programs that came with ubuntu without running any command-line operations?
Reply
#4
RE: Programming in C++ for Ubuntu 10.04
Read the documentation I linked to.

It does what you wanted.

If you want your program to pop up it's own window, make a shell script with
Code:
#!/bin/sh
xterm -t foo  -e myprogram &

Chmod +x it and click on it instead to launch your cui. Or you could make a real gui...
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  OMG! Ubuntu Linux Christian Edition. LOL Phish 7 5412 September 10, 2012 at 2:02 pm
Last Post: Autumnlicious
  I love programming Darwinian 7 2803 June 20, 2010 at 1:29 pm
Last Post: Tiberius
  25 popular programming languages Rob 9 2488 April 11, 2010 at 10:18 pm
Last Post: Disinter
  Which programming language Darwinian 34 7867 March 11, 2010 at 10:40 pm
Last Post: Rob
  Ubuntu Darwinian 22 7550 June 4, 2009 at 4:06 pm
Last Post: Kyuuketsuki



Users browsing this thread: 1 Guest(s)