LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-23-2008, 08:32 AM   #1
phanipalagummi
LQ Newbie
 
Registered: Nov 2008
Posts: 23

Rep: Reputation: 15
gcc compile error


i m quite experience in c(xp),but very new to linux

my doubt is in gcc-compilation

I have a hello.c file stored on desktop

and when i do this

Code:
gcc -o hello hello.c

i m getting the following error

Code:
hello.c: No such file or directory
gcc: no input files
 
Old 11-23-2008, 08:45 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Welcome to LQ!!

The easy answer could be that you are not in the "Desktop" directory when you run the command. Pathname and Filenames in Linux are:
relative---meaning from the current position
absolute---full pathname from /----eg: /home/username/Desktop/hello.c

For relative pathnames, you also have "..", meaning "up one"

So--if you are in the Desktop directory, and your file is in your home directory, you could access it using "../filename"
 
  


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
C pthreads -- gcc compile error hussainahsan Programming 4 12-11-2006 12:43 AM
gcc compile error? wampire Programming 3 05-06-2006 08:05 PM
compile GCC 4.0 error! ayiiq180 Linux - Software 3 04-22-2005 04:04 PM
compile error with gcc 3.3.2 on Mandrake 10 nboul Linux - Software 0 09-26-2004 06:53 PM
gcc-2.3.2 compile error rimo Linux From Scratch 33 07-30-2003 07:55 AM


All times are GMT -5. The time now is 12:25 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration