Re: Cross-compiling chicken crunch from linux to windows

Peter Bex via Chicken-users <[email protected]>
Newsgroups gmane.lisp.scheme.chicken
Message-ID <aPm1mWDfvMxxnCCK@doggett>
Hi Srayan,

CHICKEN has extensive support for cross-compilation.  See the following
manual section: https://wiki.call-cc.org/man/5/Cross%20development

You can't simply call a cross compiler on the output of the Scheme to C
translation, because you will need to use the headers and libraries for
the target platform.

I'm not sure about the warnings, those may be ignorable.  But the error
with raylib.h is probably that the cross-compiler doesn't know where to
find the cross-targeted raylib library and its headers.

Cheers,
Peter

On Thu, Oct 23, 2025 at 04:45:20AM +0000, Srayan Jana via Chicken-users wrote:
> Hello again!
> 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
> /usr/local/include/chicken/crunch.h:1391:23: warning: assignment to ‘FILE *’ {aka ‘struct _iobuf *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>  1391 |         p->data->file = fmemopen(s->data, s->size, "r");
>       |                       ^
> /usr/local/include/chicken/crunch.h: In function ‘crunch_open_input_bytevector’:
> /usr/local/include/chicken/crunch.h:1403:23: warning: assignment to ‘FILE *’ {aka ‘struct _iobuf *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>  1403 |         p->data->file = fmemopen(s->data, s->size, "rb");
>       |                       ^
> /usr/local/include/chicken/crunch.h: In function ‘crunch_open_output_string’:
> /usr/local/include/chicken/crunch.h:1417:23: warning: assignment to ‘FILE *’ {aka ‘struct _iobuf *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>  1417 |         p->data->file = fmemopen(buf->data, CRUNCH_BUFFER_SIZE, "w");
>       |                       ^
> /usr/local/include/chicken/crunch.h: In function ‘crunch_open_output_bytevector’:
> /usr/local/include/chicken/crunch.h:1430:23: warning: assignment to ‘FILE *’ {aka ‘struct _iobuf *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>  1430 |         p->data->file = fmemopen(buf->data, CRUNCH_BUFFER_SIZE, "wb");
>       |                       ^
> a.c: At top level:
> a.c:20:10: fatal error: raylib.h: No such file or directory
>    20 | #include "raylib.h"
>       |          ^~~~~~~~~~
> compilation terminated.
> sraya@Penelope:~/chicken-scripts$
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.