bellard / quickjs

Public repository of the QuickJS Javascript Engine.
https://bellard.org/quickjs
Other
8.52k stars 892 forks source link

Cannot compile qjs in MinGW64 for windows... #325

Open Honya2000 opened 4 months ago

Honya2000 commented 4 months ago

Hello,

Since i'm not able to use Visual Studio to compile qjs - today i tried to compile it in MinGW64 with gcc.

But i'm still not able to compile it.

It throws error: gcc -g -o qjsc .obj/qjsc.o .obj/quickjs.o .obj/libregexp.o .obj/libunicode.o .obj/cutils.o .obj/quickjs-libc.o .obj/libbf.o -lm -ldl -lpthread C:/Projects/Tools/mingw32/bin/../lib/gcc/i686-w64-mingw32/13.2.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -ldl: No such file or directory collect2.exe: error: ld returned 1 exit status

I tried to enable CONFIG_WIN32 in Makefile. But it doesn't fix problem. Also i didn't find any detailed instructions how to do this.

Honya2000 commented 4 months ago

I tried to remove all references to qjsc from Makefile but it still fails:

$ make c -o repl.c -m repl.js process_begin: CreateProcess(NULL, c -o repl.c -m repl.js, ...) failed. make (e=2): The system cannot find the file specified. make: [repl.c] Error 2 (ignored) x86_64-w64-mingw32-gcc -g -Wall -MMD -MF .obj/repl.o.d -Wno-array-bounds -Wno-format-truncation -fwrapv -D_GNU_SOURCE -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM -D__USE_MINGW_ANSI_STDIO -O2 -c -o .obj/repl.o repl.c process_begin: CreateProcess(NULL, x86_64-w64-mingw32-gcc -g -Wall -MMD -MF .obj/repl.o.d -Wno-array-bounds -Wno-format-truncation -fwrapv -D_GNU_SOURCE -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM -D__USE_MINGW_ANSI_STDIO -O2 -c -o .obj/repl.o repl.c, ...) failed. make (e=2): The system cannot find the file specified. make: *** [.obj/repl.o] Error 2

Honya2000 commented 4 months ago

Looks like qjsc is used to compile repl.c, which is used to compile qjs. So since i cannot compile qjsc under windows, i cannot compile qjs as well. But why documentation said windows compilation is supported under mingw64 ?

Honya2000 commented 4 months ago

Ok, i finally was able to compile almost everything by using msys2 instead of mingw64.