Current time: 18th May 2013, 18:48

Our server costs $125 a month to run. Since January 2013 we have raised $263.37.
Please help keep our community online by donating what you can. Also visit our sister site: Freethought Forums!
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programming in C++ for Ubuntu 10.04
4th August 2010, 03:40 (This post was last modified: 4th August 2010 03:40 by The_Flying_Skeptic.)
Post: #1
    3 years membership!
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?
Rate user Find all posts by this user
Quote this message in a reply
4th August 2010, 03:56
Post: #2
  5k posts! 3 years membership!
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.
Rate user Find all posts by this user
Quote this message in a reply
4th August 2010, 04:37 (This post was last modified: 4th August 2010 04:40 by The_Flying_Skeptic.)
Post: #3
    3 years membership!
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?
Rate user Find all posts by this user
Quote this message in a reply
4th August 2010, 09:52
Post: #4
  5k posts! 3 years membership!
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...
Rate user Find all posts by this user
Quote this message in a reply
Kudos given by (1): Rob
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OMG! Ubuntu Linux Christian Edition. LOL Phish 7 1151 10th September 2012 19:02
Last Post: Moros Synackaon
  I love programming Darwinian 7 1000 20th June 2010 18:29
Last Post: Tiberius
  25 popular programming languages Rob 9 1088 12th April 2010 03:18
Last Post: Disinter
  Which programming language Darwinian 34 3636 12th March 2010 03:40
Last Post: Rob
  Ubuntu Darwinian 22 2645 4th June 2009 21:06
Last Post: Kyuuketsuki



User(s) browsing this thread: 1 Guest(s)