5 This file contains specific information for usage of TinyCC
6 under MS-Windows. See tcc-doc.html to have all the features.
9 Installation from the binary ZIP package:
10 -----------------------------------------
11 Unzip the package to a directory of your choice.
16 To be able to invoke the compiler from everywhere on your computer by
17 just typing "tcc", please add the directory containing tcc.exe to your
23 Open a console window (DOS box) and 'cd' to the examples directory.
25 For the 'Fibonacci' example type:
29 For the 'Hello Windows' GUI example type:
33 For the 'Hello DLL' example type
36 tiny_impdef dll.dll (optional)
37 tcc hello_dll.c dll.def
40 Using libtcc as JIT compiler in your program
41 --------------------------------------------
42 Check out the 'libtcc_test' example:
44 - Running it from source:
45 tcc -I libtcc libtcc/libtcc.def -run examples/libtcc_test.c
48 tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def
50 - Compiling with MinGW:
51 gcc examples/libtcc_test.c -I libtcc libtcc.dll
53 - Compiling with MSVC:
54 lib /def:libtcc\libtcc.def /out:libtcc.lib
55 cl /MD examples/libtcc_test.c -I libtcc libtcc.lib
58 Import Definition Files:
59 ------------------------
60 To link with Windows system DLLs, TCC uses import definition
61 files (.def) instead of libraries.
63 The included 'tiny_impdef' program may be used to make additional
64 .def files for any DLL. For example:
66 tiny_impdef.exe opengl32.dll
68 Put opengl32.def into the tcc/lib directory. Specify -lopengl32 at
69 the TCC commandline to link a program that uses opengl32.dll.
74 The system header files (except _mingw.h) are from the MinGW
79 From the windows headers, only a minimal set is included. If you need
80 more, get MinGW's "w32api" package. Extract the files from "include"
81 into your "tcc/include/winapi" directory.
86 TCC can link windows resources in coff format as generated by MinGW's
87 windres.exe. For example:
89 windres -O coff app.rc -o appres.o
90 tcc app.c appres.o -o app.exe
95 The included tiny_libmaker tool by Timovj Lahde can be used as
96 'ar' replacement to make a library from several object files:
98 tiny_libmaker [rcs] library objectfiles ...
101 Compilation from source:
102 ------------------------
103 * You can use the MinGW and MSYS tools available at
107 Untar the TCC archive and type in the MSYS shell:
109 ./configure [--prefix installpath]
113 The default install location is c:\Program Files\tcc
115 * Alternatively you can compile TCC with just GCC from MinGW using
117 build-tcc.bat (from the win32 directory)
119 To install, copy the entire contents of the win32 directory to
125 - On the object file level, currently TCC supports only the ELF format,
126 not COFF as used by MinGW and MSVC. It is not possible to exchange
127 object files or libraries between TCC and these compilers. However
128 libraries for TCC from objects by TCC can be made using tiny_libmaker
131 - No leading underscore is generated in the ELF symbols.
133 - Bounds checking (option -b) is not supported on 64-bit OS.
136 Documentation and License:
137 --------------------------
138 TCC is distributed under the GNU Lesser General Public License. (See
139 COPYING file or http://www.gnu.org/licenses/lgpl-2.1.html)
141 TinyCC homepage is at:
143 http://fabrice.bellard.free.fr/tcc/
146 WinAPI Help and 3rd-party tools:
147 --------------------------------
148 The Windows API documentation (Win95) in a single .hlp file is
149 available on the lcc-win32 site as "win32hlp.exe" or from other
150 locations as "win32hlp_big.zip".
152 A nice RAD tool to create windows resources (dialog boxes etc.) is
153 "ResEd", available at the RadASM website.