Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > Your Distro > Ubuntu Help
Reload this Page I am trying to compile C program...what is this error
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Ubuntu Help Discussion and help about Ubuntu, Kubuntu, Xubuntu, and all the Ubuntu family

Reply
 
Thread Tools Display Modes
Old 05-17-2008   #1 (permalink)
addictive
Just Joined!
 
Join Date: May 2008
Posts: 2
I am trying to compile C program...what is this error

i am totally new to linux thing with very little know how of programming.......
i wrote a very simple following program...

#import <stdio.h>
#import <string.h>

void main()
{
printf("yes it works");
return;
}

but ended with the following set of errors actuall more errors than the line of code.....

first.c:1:18: error: stdio.h: No such file or directory
first.c:2:19: error: string.h: No such file or directory
first.c: In function ‘main’:
first.c:6: warning: incompatible implicit declaration of built-in function ‘printf’
first.c:5: warning: return type of ‘main’ is not ‘int’

can anybody help to start learning it

Thanks.
addictive is offline   Reply With Quote
Old 05-17-2008   #2 (permalink)
rcgreen
Linux Enthusiast
 
rcgreen's Avatar
 
Join Date: May 2006
Location: the hills
Posts: 507
Send a message via Yahoo to rcgreen
Something is missing, namely the stdio.h header file.

In case things didn't get installed, open a terminal and type the
command sudo apt-get install build-essential

This installs everything for compiling software. It's a mystery
why it wasn't there, but...
rcgreen is offline   Reply With Quote
Old 05-17-2008   #3 (permalink)
break_sec
Just Joined!
 
Join Date: May 2008
Posts: 3
Use #include instead of #import.
break_sec is offline   Reply With Quote
Old 05-17-2008   #4 (permalink)
addictive
Just Joined!
 
Join Date: May 2008
Posts: 2
Thumbs up

I was wondering if the compiler is installed then why its not recognizing header files.....neways given command worked and code is successfully compiled.....thanks
addictive is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 01:18 AM.

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0