summary refs log tree commit diff stats
path: root/tinyc/win32/tcc-win32.txt
blob: 5b8ddb4043a94e454e4d118518d05727fe09da08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
    TinyCC
    ======

    This file contains specific information for usage of TinyCC
    under MS-Windows.  See tcc-doc.html to have all the features.



    Compilation from source:
    ------------------------
    * You can use the MinGW and MSYS tools available at

    	http://www.mingw.org

    Untar the TCC archive and type in the MSYS shell:
    
       ./configure
       make
       make install 

    The default install location is c:\Program Files\tcc


    * Alternatively you can compile TCC with just GCC from MinGW using

	win32\build-tcc.bat

    To install, copy the entire contents of the win32 directory to
    where you want.



    Installation from the binary ZIP package:
    -----------------------------------------
    Unzip the package to a directory of your choice.
    
    (Note that the binary package does not include libtcc.  If you
    want TCC as dynamic code generator, please use the source code
    distribution.)



    Set the system PATH:
    --------------------
    To be able to invoke the compiler from everywhere on your computer by
    just typing "tcc", please add the directory containing tcc.exe to your
    system PATH.



    Examples:
    ---------
    Open a console window (DOS box) and 'cd' to the examples directory.

    For the 'Fibonacci' example type:

	tcc fib.c

    For the 'Hello Windows' GUI example type:

	tcc hello_win.c

    for the 'Hello DLL' example type

	tcc -shared dll.c
	tiny_impdef dll.dll (optional)
        tcc hello_dll.c dll.def



    Import Definition Files:
    ------------------------
    To link with Windows system DLLs, TCC uses import definition
    files (.def) instead of libraries.

    The included 'tiny_impdef' program may be used to make additional 
    .def files for any DLL. For example:

        tiny_impdef.exe opengl32.dll

    Put opengl32.def into the tcc/lib directory.  Specify -lopengl32 at
    the TCC commandline to link a program that uses opengl32.dll.



    Header Files:
    -------------
    The system header files (except _mingw.h) are from the MinGW
    distribution:

	http://www.mingw.org/

    From the windows headers, only a minimal set is included.  If you need
    more,  get MinGW's "w32api" package.



    Resource Files:
    ---------------
    TCC can link windows resources in coff format as generated by MinGW's
    windres.exe.  For example:

        windres -O coff app.rc -o appres.o
        tcc app.c appres.o -o app.exe



    Tiny Libmaker:
    --------------
    The included tiny_libmaker tool by Timovj Lahde can be used as
    'ar' replacement to make a library from several object files:

	tiny_libmaker [rcs] library objectfiles ...



    Limitations:
    ------------
    - On the object file level, currently TCC supports only the ELF format,
      not COFF as used by MinGW and MSVC.  It is not possible to exchange
      object files or libraries between TCC and these compilers.  However
      libraries for TCC from objects by TCC can be made using tiny_libmaker
      or MinGW's ar.

    - No leading underscore is generated in the ELF symbols.

    - With DLLs, only functions (not data) can be im-/exported.

    - Bounds checking (option -b) is not supported currently.

    - 64-bit systems are not (yet) supported.



    Documentation and License:
    --------------------------
    TCC is distributed under the GNU Lesser General Public License. (See
    COPYING file or http://www.gnu.org/licenses/lgpl-2.1.html)

    TinyCC homepage is at:

	http://fabrice.bellard.free.fr/tcc/



    WinAPI Help and 3rd-party tools:
    --------------------------------
    The Windows API documentation (Win95) in a single .hlp file is
    available on the lcc-win32 site as "win32hlp.exe" or from other
    locations as "win32hlp_big.zip".

    A nice RAD tool to create windows resources (dialog boxes etc.) is
    "ResEd", available at the RadASM website.



    --- grischka