I use the GCC C compiler on both MacOS and Windows with no problems. Recently I have been compiling with GCC utilizing GTK for the user interface along with a SQLite database to create my cross-platform food recipe finder app.

Below are the compiler instructions I include in my app for both MacOS and Windows that may help you with your current situation. (Note that my app links json, curl, gumbo, and sqlite3 libraries, which are part of the compiler switches I need.)


Best of luck,


John M. 


My GitHub repo webpage for the first release of recipe_finder.c is: 


https:/github.com/j2kGit/recipe_finder


---------------------------------------------------------------------------

 BUILD INSTRUCTIONS AND COMPILER NOTES:

     (AS OF SEPTEMBER 2025)

---------------------------------------------------------------------------


macOS (Homebrew):


- Install dependencies:

    brew install gcc@13 pkg-config gtk+3 json-c curl gumbo-parser sqlite node npm


- Link GCC 13 so it’s available as `gcc-13`:

    brew link gcc@13 --overwrite


- Install Playwright + supporting npm packages:

    npm install -g playwright cheerio axios

    npx playwright install


- macOS compile command:


gcc-13 $(pkg-config --cflags gtk+-3.0 json-c libcurl gumbo sqlite3) -std=c11 -Wall -Wextra -g recipe_finder_db.c -o recipe_finder_db $(pkg-config --libs gtk+-3.0 json-c libcurl gumbo sqlite3)


What it does:

    • gcc-13  Calls GCC version 13 from Homebrew (`/opt/homebrew/bin/gcc-13` on Apple Silicon).

    • $(pkg-config --cflags gtk+-3.0 json-c)  Adds include paths for GTK 3 and json-c.

    • -std=c11 -Wall -Wextra -g   Enables C11 standard, warnings, and debugging info.

    • recipe_finder_db.c   Your source file.

    • -o recipe_finder_db   Names the compiled binary.

    • $(pkg-config --libs gtk+-3.0 json-c)   Adds linker flags for GTK 3 and json-c.

    • -lcurl -lgumbo -lsqlite3   Links curl, gumbo, and sqlite3 libraries.


Tips:

    • Use `brew --prefix` to troubleshoot include or library paths.

    • On macOS, system curl may conflict with Homebrew’s; if you see linker errors, try:

        pkg-config --cflags --libs libcurl

    • Sometimes you may also need `-lm` (math library).

    • GTK 3 GUI apps may require XQuartz on macOS.


---------------------------------------------------------------------------


 Windows (MSYS2 MinGW 64-bit):


 GCC Compiler Notes:


     - Compiler: GCC (MSYS2 MinGW 64-bit)

     - Required version: GCC 11.0 or higher

         (Due to use of C11 features and GLib/GTK compatibility)

     - Recommended: GCC 15.2.0 or later

         (Latest tested version: 15.2.0, updated 2025-08-17)

         (Check with: gcc --version)


     - MSYS2 Environment:

         - Terminal: MSYS2 MinGW 64-bit shell (MINGW64)

         - MSYS2 runtime version: 3.6.4-1

             (Verify with: pacman -Qi msys2-runtime)

         - Kernel/environment info: MINGW64_NT-10.0-26100

             (Verify with: uname -a)

         - pacman version: 6.1.0

             (Verify with: pacman -V)


     - Install required dependencies:


         pacman -S mingw-w64-x86_64-gtk3 \

                   mingw-w64-x86_64-json-c \

                   mingw-w64-x86_64-curl \

                   mingw-w64-x86_64-gumbo


     - GTK version used in development: GTK 3.24.50 (as of September 2025)


     Windows compile command:


gcc -o recipe_finder_db.exe recipe_finder_db.c $(pkg-config --cflags --libs gtk+-3.0 json-c) -lcurl -lgumbo -lsqlite3 -Wall -Wextra -std=c11 -g


---------------------------------------------------------------------------



On Oct 2, 2025, at 2:43 AM, Hubert Kauker <[email protected]> wrote:

I am trying to find out whether tcc is a good alternative to cc and gcc on a Mac. 

It will be fine for me to have all of ANSI C (C89/C90), much of the C99 ISO standard, and many GNU C extensions including inline assembly.
So I cloned from repo.or.cz/tinycc.git and followed the instructions.

I was able able to build the following version:
tcc version 0.9.28rc 2025-09-21 mob@ba0899d9 (x86_64 Darwin)

Fine. But “make test” obviously ran into 2 issues. Here is the output:

/Library/Developer/CommandLineTools/usr/bin/codesign_allocate: fatal error: file not in an order that can be processed (symbol table out of place): /Users/hubert/Documents/Git/C/tinycc/tests/hello
hello: the codesign_allocate helper tool cannot be found or used
tcc: error: command failed 'codesign -f -s - hello'
+ ../tcc -vv
tcc version 0.9.28rc 2025-09-21 mob@ba0899d9 (x86_64 Darwin)

install: /usr/local/lib/tcc
include:
  /usr/local/lib/tcc/include
  /usr/local/include
  /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
libraries:
  /usr/local/lib/tcc
  /usr/lib
  /lib
  /usr/local/lib
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
libtcc1:
  /usr/local/lib/tcc/libtcc1.a
+ otool -L ../tcc
../tcc:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
+ exit 1
make[2]: *** [hello-exe] Error 1
make[1]: *** [all] Error 2
make: *** [test] Error 2

The first message seems to say that my codesign_allocate tool is not suitable. Both codesign and codesign_allocate are in /usr/bin and can be found.

QUESTION 1:
What is wrong and what can I do about it?

However, changing into the examples folder, I can use “tcc -run” on ex1.c to get “Hello world”. Fine. But omitting “-run” produces the same error about codesign_allocate as above.

After searching for OSX in the changelog, I found the following remark about version 0.9.26:
Support OSX (tcc -run only) (Milutin Jovanovic)
Strange. What does it mean? 

QUESTION 2:
Does it mean that tcc does not fully support OSX - it’s experimental? TCC cannot produce native OSX executables?
Is this state of affairs still officially present in the current 0.9.28rc?

Then I noticed that tcc is also available via Homebrew. Now, “brew install tcc” tells me:

Fetching downloads for: tcc
Warning: tcc has been deprecated because it is not supported upstream! It will be disabled on 2026-09-16.
==> Fetching tcc
==> Pouring tcc--0.9.27_1.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/tcc/0.9.27_1: 20 files, 723.7KB
==> Running `brew cleanup tcc`
==> No outdated dependents to upgrade!

QUESTION 3:
What is that about being deprecated, not being supported upstream and being disabled from 2026-09-16? Is that serious?

After that I have:
tcc version 0.9.27 (x86_64 Darwin)

Fine. Now back to examples and “tcc -run ex1.c” producing “Hello world”. Fine. 
But “tcc ex1.c” this time produces:

tcc: error: file 'crt1.o' not found
tcc: error: file 'crti.o' not found
/usr/lib/libc.dylib: error: bad architecture
tcc: error: library 'c' not found
tcc: error: file 'crtn.o' not found
tcc: error: undefined symbol ‘printf'

So it seems, I didn’t make much progress.

QUESTION 4:
How should I go on from here?

Thanks.










_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to