tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] libtcc win32


From: grischka
Subject: Re: [Tinycc-devel] libtcc win32
Date: Fri, 04 Dec 2009 22:08:10 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Christophe Faure wrote:
It is possible to use libtcc for a program compiled with tcc under win32.

It is also possible to create libtcc as dll, then it can be used
by all programs, no matter what they are compiled with.

$ cd win32
$ tcc ../libtcc.c -shared -DLIBTCC_AS_DLL -o tcc.dll
$ tcc ../tests/libtcc_test.c -I.. -ltcc -L.
$ libtcc_test

You can also create a tcc.exe that uses libtcc.dll.  It is very
small.  You'd need to export more symbols from the dll however
(for gcc, use -Wl,--export-all-symbols)

$ tcc ../libtcc.c -shared -DLIBTCC_AS_DLL -o tcc.dll -rdynamic
$ tcc ../tcc.c -DTCC_USE_LIBTCC -ltcc -L. -o tcc_small.exe
$ tcc_small -v

Similar things are possible on linux too:

$ tcc libtcc.c -shared -o libtcc.so -ldl
$ tcc tests/libtcc_test.c -o libtcc_test -ltcc -L. -I.
$ LD_LIBRARY_PATH=. ./libtcc_test
$ tcc tcc.c -DTCC_USE_LIBTCC -o tcc_small -ltcc -L.
$ LD_LIBRARY_PATH=. ./tcc_small -v

--- grischka





reply via email to

[Prev in Thread] Current Thread [Next in Thread]