tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Here is how to compile resources on wind ows with tcc.


From: address@hidden
Subject: [Tinycc-devel] Here is how to compile resources on wind ows with tcc.
Date: Wed, 12 Feb 2014 12:00:27 -0800

Here is how to compile resources on windows with tcc.

Most of these instructions for compiling resources on windows are already include in "tcc/docs/tcc-win32.txt", but I'll reiterate them here.


--------------------------------------
File I used. Others versions may work.
--------------------------------------

tcc
tcc-0.9.26-win32-bin.zip

windres.exe
cogtool.hcii.cs.cmu.edu/trac/browser/tags/1.0beta15/lib/build-only/launch4j/bin/windres.exe?rev=1424

mingw winapi
sourceforge.net/projects/mingw/files/MinGW/Base/w32api/w32api-3.12/w32api-3.12-mingw32-dev.tar.gz/download
Newest version 4.* caused errors for me when compiling. Had this version on my computer so thats what i used.


---------------------------------------
Directions (with tcc already extracted)
---------------------------------------

1. Put windres.exe in the same directory as tcc.exe

2. Hex edit windres.exe search for "gcc -E -xc" and modify "gcc" to "tcc". Or if you dont have a hex editor then copy "tcc.exe", rename the copy to "gcc.exe"

3. Extract "w32api-3.12-mingw32-dev.tar.gz" and copy all the header files from "include/" directory into the "tcc/includes/winapi/" directory overwriting everything.

4. Follow the instructions in the "tcc/doc/tcc-win32.txt" on resources. Note that IDC_STATIC is not defined see optional step 6 below.


--------------------------------------------------
Optional Windows Command Script Files (batch file)
--------------------------------------------------

5. Create a batch file for a "tcc console" I named mine "console.cmd" with the following line in it (You will need to modify this if tcc is not installed in the "C"\tcc" directory):

@%comspec% /k "title tcc console & set PATH=c:\tcc;%PATH%"

Just copy it where you want it, double click.


6. Create a batch file called "rc.cmd" in the same directory as "tcc.exe" with the following line in it:

@windres -D IDC_STATIC=-1 -O coff "%~1" -o "%~1.o"

To compile a resource just have the directory for tcc in your path and type "rc filename.ext" this will create a file compiled object named "filename.ext.o". Then just compile with tcc, for example "tcc main.c main.rc.o -o app.exe".


reply via email to

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