C programming in Damn Samll Linux.Is it possible?

Status
Not open for further replies.
I have the Live Cd Distro of Damn Small Linux.Its really cool.I am able to learn a lot of unix commands from the xterm.But alas,i aint able to compile any of the programs that i type in vi editor
(eg: i created a sample file a.c
in the $ prompt i gave :$cc a.c
cc : command not found.... was the reply.)
now is it possible to compile c progams in DSL?
pls tell me!
Thanks
 

GNUrag

FooBar Guy
DSL contains a tiny ANSI C compiler named tcc

Use $ tcc filename.c to compile your c programs
 
OP
I

imagineer_aman

Broken In
Dear pradeep,
gcc does not work. it says the same thing...
gcc:command not found.

Dear Gnurag,
tcc does work but i get an error saying "stdio.h" not found.so i just copied stdio.h file in the same folder as a.c
Still it gives the same error.
How do i make the compiler work??
 

GNUrag

FooBar Guy
its a tiny c compiler, so many things wont work out of the box.

if you copy stdio.h file in the same folder as a.c then you have to declare the include statement like this:

#include "stdio.h"

i'm skeptical if this works.. you may need to copy more header files, or install proper compiler like gcc
 
OP
I

imagineer_aman

Broken In
Hey guys.
Thanks a ton for the replies.
i found out how to make the compiler work
i just need to type the program as follows...
void main()
{printf("HI");}//without including stdio.h

$tcc a.c //to compile using Tiny C Compiler
$./a.out //to get the o/p
 
Status
Not open for further replies.
Top Bottom