Programming and Scripting :: tcc / c library problem



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.

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

I will try. Thanx for now
I tried and it worked.Thanx clacker
Is tcclib.h the substitute of all other libraries too?

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.

Next Page...
original here.