[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] tcc version 0.9.25 under Windows XP: "-static"doesn't
From: |
Timo VJ Lähde |
Subject: |
Re: [Tinycc-devel] tcc version 0.9.25 under Windows XP: "-static"doesn't work at all |
Date: |
Fri, 13 Aug 2010 10:42:33 +0300 |
Without -static switch tcc.exe use msvcrt.def and kernel32.def for linking.
With -static switch tcc.exe search libmsvcrt.a and libkernel32.a for
linking and those doesn't exist at all.
Example for own lib:
tcc.exe -c foo-lib.c
tiny_libmaker libfoo.a foo-lib.o
tcc1 foo-test.c -lfoo -L.
--------------foo-lib.c------------
// foo-lib.c
int foo(int a, int b)
{
return a+b;
}
--------------foo-test.c-----------
// foo-test.c
int foo(int a, int b);
int main(void)
{
printf("%d\n", foo(1, 2));
}
-----------------------------------
-- Timppa
----- Original Message -----
From: "Wenzel" <address@hidden>
To: "tcc" <address@hidden>
Sent: Friday, August 13, 2010 8:13 AM
Subject: [Tinycc-devel] tcc version 0.9.25 under Windows XP:
"-static"doesn't work at all
Hello:
I'm not able to build any statically linked executable under Windows XP.
Whatever "-L" and "-l" options I provide, tcc just returns "undefined
symbol", e. g.:
#include <stdio.h>
int main(void)
{
puts("Hello, world!");
exit(0);
}
E:\tmp>tcc -static -Le:\tcc\lib -ltcc1 test.c -o test.exe
tcc: undefined symbol 'puts'
tcc: undefined symbol 'exit'
tcc: undefined symbol '_controlfp'
tcc: undefined symbol '__set_app_type'
tcc: undefined symbol '__getmainargs'
Of course, this example doesn't make much sense because I could build it
without "-static ...". But if I add my own "libxxx.a" I get its symbols
"undefined", too!
If I'am doing something wrong, please excuse and hint.
Regards
Werner
_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel