LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2010, 01:04 AM   #1
contentprovider
LQ Newbie
 
Registered: Feb 2010
Location: on the planet earth
Distribution: ubuntu, redhat, centos5
Posts: 1

Rep: Reputation: 0
Smile trying to get c to run on ubuntu.


i have an example c program.. which I have loaded with my text editor..
into my documents on ubuntu.. each time I try to run it, I get the message command not found.. must i make it first, or is it a path problem. ?
 
Old 02-15-2010, 01:09 AM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
cd into the path that the c program lies in. Then try
Code:
./<your app name>
this should run the application using relative path reference.
 
Old 02-15-2010, 01:42 AM   #3
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
Code:
export PATH=.:$PATH
then try it again.
 
Old 02-15-2010, 04:17 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Quote:
I have an example c program..
which I have loaded with my text editor..
A text file "c program" cannot be run.

Example : example.c → you will have to compile it.
gcc example.c -o example

Use it : 1) cd <path-to-folder-with-example>/example
2) ./example

Or : # cp example /usr/local/bin/
.. Then it is in your PATH.
.....
 
Old 02-15-2010, 10:22 AM   #5
halborr
Member
 
Registered: Aug 2009
Posts: 112

Rep: Reputation: 18
Quote:
Originally Posted by knudfl View Post
A text file "c program" cannot be run.

Example : example.c → you will have to compile it.
gcc example.c -o example

Use it : 1) cd <path-to-folder-with-example>/example
2) ./example

Or : # cp example /usr/local/bin/
.. Then it is in your PATH.
.....
You might have to "chmod +x example" to execute it. ("ls -l" lists current permissions).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to run Ubuntu under XP ? Johnny Faster Linux - Virtualization and Cloud 10 02-10-2010 03:53 AM
Run .RUN FILES at ubuntu 9.10 Taso5 Linux - Software 17 11-30-2009 05:57 PM
How to run Linux/Ubuntu when we use to run XpPro and are novice in Linux language largo16 Linux - General 7 05-27-2008 04:19 PM


All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration