Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Creating Linux executable in Eclipse(Hello world from the command line ??)
Creating Linux executable in Eclipse [message #760060] Thu, 01 December 2011 06:49 Go to next message
Vernon is currently offline VernonFriend
Messages: 1
Registered: December 2011
Junior Member
Just installed Eclipse on Ubuntu Linux PC (I am very new at Linux). I got the Hello World (C program) to build and run fine in the little terminal box at the bottom right of eclipse and everything I can set is set to executable. How do I get the program to run without eclipse - say from the command line ? When I click on it it does nothing - likewise if I am in the appropriate executable directory and type it in the terminal.

Thanks for helping !
Re: Creating Linux executable in Eclipse [message #760152 is a reply to message #760060] Thu, 01 December 2011 13:42 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2011.11.30 23:49, Vernon wrote:
> Just installed Eclipse on Ubuntu Linux PC (I am very new at Linux). I
> got the Hello World (C program) to build and run fine in the little
> terminal box at the bottom right of eclipse and everything I can set is
> set to executable. How do I get the program to run without eclipse - say
> from the command line ? When I click on it it does nothing - likewise if
> I am in the appropriate executable directory and type it in the terminal.
> Thanks for helping !

First, you should ask such questions, about C/C++, in the Eclipse CDT forum.

For your case, however, it depends on whether or not your makefile
renames a.out to some better name you specify. (Eclipse CDT may do
something like this, I don't know. I have 30 years in C behind me, but
I've never used Eclipse to do it in.)

Second, you must make your linked file executable:

vernon:~/development> chmod a+x myprogram

Then, from the command line, your executable will just run as long as a)
you're in its parent subdirectory:

vernon:~/development> ./myprogram

or b) it's in one of the subdirectories in your PATH variable:

vernon:~> which myprogram
/home/vernon/development/myprogram
vernon:~> myprogram

or c) you open a Nautilus or other GUI file browser and double-click its
icon in the file system.

Based on the information you give, it's pretty hard to steer you
exactly. I hope what I'm saying here clicks somewhere with what you
already know. As I say, your best bet is to associate with "others of
your kind" in the Eclipse CDT forum. You'll get faster and better advice
from them.

Best regards,

Russ
Previous Topic:FATAL ERROR: No such file or directory??
Next Topic:Need help with /frameset syntax in INDEX.JSP for reports with parameters.
Goto Forum:
  


Current Time: Tue Jun 22 02:06:35 GMT 2021

Powered by FUDForum. Page generated in 0.03289 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top