TCC won't compile


Forum: Apps
Topic: TCC won't compile
started by: Tethys

Posted by Tethys on Feb. 07 2004,15:52
I have a very simple program

=====
/*Filename test.c */
int main()
{    int x=2,y=3;
    int z=x+y;
    return 0;
}
=====
I try to compile it using the command

tcc test.c

and it returns the error
Undefined symbol __libc_start_main

It's the same for any program I try. What is the problem? Am I doing something wrong?

Posted by enthusi on Feb. 07 2004,17:08
yes :)
But  you could hardly have known...
You have to tell TCC to which lib to link. There have been similiar topics arround.
You may wanna have a look at the tcc-how-tos or use a search.
But the direct answer to your problem would be: compile with:
Code Sample
tcc -o test.run -lstdc++-3-libc6.1-2-2.10.0 test.c

You may also wanna take a look at that small TCC-tutorial of mine arround in the How-To-Forum...
That might clear things up a bit when it comes to linking and stuff...
Hope that helps,
enthusi

Posted by Tethys on Feb. 08 2004,08:36
Ah thanks a lot. That helped :)
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.