tcc / c library problem
Forum: Programming and Scripting
Topic: tcc / c library problem
started by: kilmister_2
Posted by kilmister_2 on Oct. 18 2006,11:57Hi 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.
Posted by clacker on Oct. 18 2006,12:19tcc is funny that way, you need to use tcclib.h instead of stdio.h, like so:
Then compile it with:
tcc hello.c -o hello
Posted by kilmister_2 on Oct. 19 2006,12:19I will try. Thanx for now
Posted by kilmister_2 on Oct. 20 2006,14:29I tried and it worked.Thanx clacker
Is tcclib.h the substitute of all other libraries too?
Posted by clacker on Oct. 20 2006,15:42No, 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.
Posted by kilmister_2 on Oct. 23 2006,08:24thank you for the information, clacker.
Posted by ubermai on Dec. 23 2006,09:00Using the gcc1-with-libs extension in both .dsl and .unc format, I have not been able to compile my first C program.
Here's the program:
I've tried a bunch of different options at the command line, but I haven't found one that works. Maybe my program has been improperly written?