TCC is a tiny C compiler which enables you to use C as scripting language.
Questions tagged [tcc]
117 questions
2
votes
2 answers
Compiling a file with TCC on windows with a library from C99
So the latest version of TCC supposedly has some of the features of C99 implemented, however, I have found that it does not include C99's Math library.
Is there a way I can get it to use more of C99's libraries on windows? I googled around and found…

timsbleung
- 41
- 1
- 1
- 4
2
votes
1 answer
TCC invoke a function returning a double
Has anyone successfully invoked a function returning a double with TCC's libtcc?
I defined a function to return a double in my code and through tcc_add_symbol added it to libtcc. When I invoked this function in tcc scripts and got the returned…

user1531899
- 23
- 2
2
votes
1 answer
TCC with Visual Studio 2012
I am trying to integrate Visual C++ 2012 and TCC in such as way as to send in a C function (as a string) into the tcc compiler (libtcc.dll). I have added the libtcc.h header file, though I am unsure how to add the libtcc.dll since there is no…

Bill Tricarico
- 21
- 2
1
vote
1 answer
Tcc Error : "-run is not available in a cross compiler"
I tried compiler TCC(Tiny C compiler: https://bellard.org/tcc/) form source code:
$ pwd
/cygdrive/D/Download/tcc-0.9.27/tcc-0.9.27
Administrator@MS-QMYKYRDOTLFI /cygdrive/D/Download/tcc-0.9.27/tcc-0.9.27
$ ./configure
Binary directory C:/Program…

zhaoyun
- 11
- 4
1
vote
0 answers
libtcc undefined symbol for stdin
Adding fgets(buffer, 256, stdin); in the libtcc_test.c on Windows (compiling with mingw) results in stdin not being known. Adding #include results in /tcc/include/stdio.h:34: error: incompatible redefinition of 'FILE'
Whole code:
/*
*…

flamendless
- 11
- 1
1
vote
1 answer
Using TinyCC (tcc) to generate a C wrapper for V
I am trying to find some basis I can use to generate wrappers/bindings for C libraries to be used from Vlang and whilst doing so, I remembered that initially, V uses TCC for it's bootstrap compilation.
Since TCC is a very, very capable C compiler, I…

Ingwie Phoenix
- 2,703
- 2
- 24
- 33
1
vote
2 answers
Use raw binary blob of instructions in C code
I'm working with jit compilation by TCC (Tiny C Compiler) but it have a limited support for assembly and I get frequently stuck by this... I would like to know if there is some kind of trick to insert raw instructions into inline assembly? Such…

Wadosh
- 13
- 2
1
vote
1 answer
IOCCC 1987/westley.c - lvalue issues with GCC
This line-palindromic entry from the 1987 IOCCC:
https://www.ioccc.org/years.html#1987_westley
...is causing TCC 0.9.27 no issues during default compilation and works as intended.
However, GCC 9.3.0, even in -std=c89 mode, complains that the…

ChemicalDruid
- 165
- 5
1
vote
0 answers
How to link a native Windows socket library to write HTTP application using Tiny C Compiler
I'm still in the early stage of learning, and starting to write a simple HTTP application from scratch, however I was unsuccessful so far with the winsock and couldn't make it work.
What is the method to write a HTTP application, is using winsock a…

user3789797
- 450
- 6
- 15
1
vote
1 answer
Optimization levels with tiny C compiler
I've read in the manpage that
Note: GCC options -Ox, -fx and -mx are ignored.
It produces different binary sizes, compiling st with gcc -O3, the binary size is 120K and with tcc it's 112K.
Is code compiled with tcc running slower than gcc -O3?

Soft Waffle
- 356
- 1
- 12
1
vote
2 answers
How to read a flat file and put the data to corresponding variable
I have a flat file (txt file), containing some field:
Primary key, Name, Address, Salary -separated by |
like:
A0001|John|New York City|12000
A0002|Daisy|New Delhi|32000
A0003|Dany|London|23000
..
etc
How could I develop a code to search each data…

Agung Sudrajat
- 120
- 9
1
vote
0 answers
How to build a library with tcc using Windows?
I'm currently trying to use the gumbo-parser library with TCC compiler on Windows.
https://github.com/google/gumbo-parser
There are no library files included so I tried to create them by myself.
I was able to compile the get_tile.c demo by…

Daveman
- 1,075
- 9
- 26
1
vote
0 answers
tcc compiler __attribute__(section) does not put the data in the mentioned section
i'm using the tcc compiler to compile the following code:
#include
#include
void main()
{
// intializing the secret code in the secret section.
char* secret __attribute__ ((section(".secret")));
secret = "myKey";
…

Z E Nir
- 332
- 1
- 2
- 15
1
vote
3 answers
How can I make GCC generate ELF object files?
I need to use the TCC compiler to link object files generated by GCC. However, GCC in MinGW outputs object files in COFF format, and TCC only supports the ELF format. How can I make GCC generate ELF object files?
$ cat test.c
int main(void)
{
…

August Karlstrom
- 10,773
- 7
- 38
- 60
1
vote
2 answers
Can REST TCC handle PUT?
We are developing a REST API where client (application) will make call to our REST APIs.
The client (application) will handle the business logic with rollback capabilities (eg. client can rollback if update "Shipment" services [pass] and update…

Ethan
- 11
- 2