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
21 Include and library search paths
22 --------------------------------
23 On windows, the standard "include" and "lib" directories are searched
24 relatively from the location of the executables (tcc.exe, libtcc.dll).
29 Open a console window (DOS box) and 'cd' to the examples directory.
31 For the 'Fibonacci' example type:
35 For the 'Hello Windows' GUI example type:
39 For the 'Hello DLL' example type
42 tiny_impdef dll.dll (optional)
43 tcc hello_dll.c dll.def
46 Using libtcc as JIT compiler in your program
47 --------------------------------------------
48 Check out the 'libtcc_test' example:
50 - Running it from source:
51 tcc -I libtcc libtcc/libtcc.def -run examples/libtcc_test.c
54 tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def
56 - Compiling with MinGW:
57 gcc examples/libtcc_test.c -I libtcc libtcc.dll -o libtcc_test.exe
59 - Compiling with MSVC:
60 lib /def:libtcc\libtcc.def /out:libtcc.lib
61 cl /MD examples/libtcc_test.c -I libtcc libtcc.lib
64 Import Definition Files:
65 ------------------------
66 To link with Windows system DLLs, TCC uses import definition
67 files (.def) instead of libraries.
69 The included 'tiny_impdef' program may be used to make additional
70 .def files for any DLL. For example:
72 tiny_impdef.exe opengl32.dll
74 Put opengl32.def into the tcc/lib directory. Specify -lopengl32 at
75 the TCC commandline to link a program that uses opengl32.dll.
80 The system header files (except _mingw.h) are from the MinGW
85 From the windows headers, only a minimal set is included. If you need
86 more, get MinGW's "w32api" package. Extract the files from "include"
87 into your "tcc/include/winapi" directory.
92 TCC can link windows resources in coff format as generated by MinGW's
93 windres.exe. For example:
95 windres -O coff app.rc -o appres.o
96 tcc app.c appres.o -o app.exe
101 The included tiny_libmaker tool by Timovj Lahde can be used as
102 'ar' replacement to make a library from several object files:
104 tiny_libmaker [rcs] library objectfiles ...
107 Compilation from source:
108 ------------------------
109 * You can use the MinGW and MSYS tools available at
113 Untar the TCC archive and type in the MSYS shell:
115 ./configure [--prefix installpath]
119 The default install location is c:\Program Files\tcc
121 * Alternatively you can compile TCC with just GCC from MinGW using
123 build-tcc.bat (from the win32 directory)
125 To install, copy the entire contents of the win32 directory to
131 - On the object file level, currently TCC supports only the ELF format,
132 not COFF as used by MinGW and MSVC. It is not possible to exchange
133 object files or libraries between TCC and these compilers. However
134 libraries for TCC from objects by TCC can be made using tiny_libmaker
137 - No leading underscore is generated in the ELF symbols.
139 - Bounds checking (option -b) is not supported on 64-bit OS.
142 Documentation and License:
143 --------------------------
144 TCC is distributed under the GNU Lesser General Public License. (See
145 COPYING file or http://www.gnu.org/licenses/lgpl-2.1.html)
147 TinyCC homepage is at:
149 http://fabrice.bellard.free.fr/tcc/
152 WinAPI Help and 3rd-party tools:
153 --------------------------------
154 The Windows API documentation (Win95) in a single .hlp file is
155 available on the lcc-win32 site as "win32hlp.exe" or from other
156 locations as "win32hlp_big.zip".
158 A nice RAD tool to create windows resources (dialog boxes etc.) is
159 "ResEd", available at the RadASM website.