Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 11-23-2008, 09:32 AM   #1
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

gcc -o hello hello.c

i m getting the following error

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

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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"


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

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

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