Re: Cross-compiling chicken crunch from linux to windows

Srayan Jana via Chicken-users <[email protected]>
Newsgroups gmane.lisp.scheme.chicken
Message-ID <PH8PR14MB699611A54602643CF5E67900E0F1A@PH8PR14MB6996.namprd14.prod.outlook.com>
Yeah, I've been using w64devkit, it's been pretty great actually.
Also, I think in terms of having a cross platform fmemopen, this is probably your best bet
https://github.com/Snaipe/fmem
It's MIT licensed (yay!) but uses CMake (boo!)
________________________________
From: Felix Winkelmann <[email protected]>
Sent: Thursday, October 23, 2025 2:24 AM
To: Srayan Jana <[email protected]>; chicken-users <[email protected]>
Subject: Re: Cross-compiling chicken crunch from linux to windows

> I'm curious, how would you recommend cross compiling something from linux to windows when using Chicken or Crunch? Usually I'd be using something like CMake, but that's obviously not an option here.
> Trying to use Mingw gives me this error:
> sraya@Penelope:~/chicken-scripts$ x86_64-w64-mingw32-gcc a.c $(chicken-crunch -cflags) $(chicken-crunch -libs) -lraylib
> -ldl -lGL -lX11
> In file included from a.c:17:
> /usr/local/include/chicken/crunch.h: In function ‘crunch_open_input_string’:
> /usr/local/include/chicken/crunch.h:1391:25: warning: implicit declaration of function ‘fmemopen’; did you mean ‘freope’? [-Wimplicit-function-declaration]
>  1391 |         p->data->file = fmemopen(s->data, s->size, "r");
>       |                         ^~~~~~~~
>       |                         freopen

I haven't tried CRUNCH on Windows yet, but it _should_ normally work, but as
you can see above, the "fmemopen" libc call doesn't seem to be available
on Windows. I don't know if there is a replacement in the win32 API,
if you find one, please don't hesitate to send patches or suggestions to
me or this list.

I strongly recommend w64devkit, at least we can try to reproduce any
issues you find. The mingw32 toolchain landscape is a mess and one
never knows which version supports what. So please consider using
w64devkit, at least when testing code that you need help on.


cheers,
felix
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.