Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: tcc / c library problem< Next Oldest | Next Newest >
kilmister_2 Offline





Group: Members
Posts: 4
Joined: July 2006
Posted: Oct. 18 2006,11:57 QUOTE

Hi everyone,

I am at my first post on this forum.
I am new to DSL and have installed DSL to Hard Disk on a laptop; while tring to compile with tcc (the typical "hello world!") I got an error message saying " include file stdio.h not found"
I checked the /usr/include dir and infact there was no stdio.h file.
Are C libraries located in a different directory in dsl? Do I need to install any additional package?
Thanks in advance.
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Oct. 18 2006,12:19 QUOTE

tcc is funny that way, you need to use tcclib.h instead of stdio.h, like so:

Code Sample
#include <tcclib.h>

int main(int argv, char** argc)
{
 printf("Hello World!\n");
 return(0);
}


Then compile it with:

tcc hello.c -o hello
Back to top
Profile PM 
kilmister_2 Offline





Group: Members
Posts: 4
Joined: July 2006
Posted: Oct. 19 2006,12:19 QUOTE

I will try. Thanx for now
Back to top
Profile PM 
kilmister_2 Offline





Group: Members
Posts: 4
Joined: July 2006
Posted: Oct. 20 2006,14:29 QUOTE

I tried and it worked.Thanx clacker
Is tcclib.h the substitute of all other libraries too?
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Oct. 20 2006,15:42 QUOTE

No, it's fairly limited and the other libraries aren't included.  Things like math.h and the math library are not included.

If you need to compile something more complicated than a really simple program, you might try the gcc1-with-libs.dsl extension.  It includes a lot of the libraries (like libreadline and libncurses, X developement libraries, and gtk1.2 developement libraries), plus make and patch.  There is also a gcc1-with-libs.unc in the testing section that should work on lower memory machines.
Back to top
Profile PM 
6 replies since Oct. 18 2006,11:57 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: tcc / c library problem

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code