gdcv icon indicating copy to clipboard operation
gdcv copied to clipboard

Does it work in Windows?

Open soilc opened this issue 2 years ago • 3 comments

Does it work in Windows? When I compile, this comes up: $ make gdcv gcc -o gdcv gdcv.c dictzip.c utils.c format.c index.c utfproc/utf8proc.c -Wall -Wextra -pedantic -LC:/msys64/mingw64/lib -lz -O2 -march=native gdcv.c:3:10: fatal error: argp.h: No such file or directory 3 | #include <argp.h> //argp | ^~~~~~~~ compilation terminated.

soilc avatar Sep 27 '22 08:09 soilc

Sorry, it does not work on windows.

konstare avatar Sep 28 '22 16:09 konstare

I had succeeded compiling under msys (zlib, zlib-devel, libargp, libargp-devel installed) with following workaround added at the beginning of index.c

#if !defined(FNM_EXTMATCH)
#define FNM_EXTMATCH 0
#endif

and modified makefile:

CC=gcc
#clang
EMACS = emacs
CFLAGS=$(pkg-config --cflags  zlib) -Wall  -Wextra  -pedantic
OPTIMISATIONS= -O2  -march=native
LDLIBS=$(shell pkg-config --libs  zlib)
DEBUG= -O0 -g3 -ggdb 

.PHONY : test

gdcv: gdcv.c dictzip.c utils.c format.c index.c utfproc/utf8proc.c 
	$(CC)  -o $@ $^ $(CFLAGS) $(LDLIBS) -lz -largp $(OPTIMISATIONS)

emacs-module: gdcv-elisp.so gdcv.elc

gdcv-elisp.so: elisp.c dictzip.c utils.c format.c index.c utfproc/utf8proc.c
	$(CC) -shared -o $@ -fPIC $^ $(CFLAGS) $(LDLIBS)   $(OPTIMISATIONS)

gdcv_debug: gdcv.c dictzip.c utils.c format.c index.c utfproc/utf8proc.c 
	$(CC)  -o $@ $^ $(CFLAGS) $(LDLIBS) -lz -largp $(DEBUG)

clean:
	rm -f  gdcv gdcv-elisp.so gdcv_debug gdcv.elc

.SUFFIXES: .el .elc
.el.elc:
	$(EMACS) -batch -Q -L . -f batch-byte-compile $<

but it fails to index any dir with stackoverflow and following dump:

Exception: STATUS_STACK_OVERFLOW at rip=00010040AEA6
rax=0000000000009170 rbx=0000000A00001C62 rcx=00000007FFE03A30
rdx=0000000A00000490 rsi=0000000000000000 rdi=0000000000000002
r8 =0000000000000023 r9 =0000000A00000480 r10=0000000800000000
r11=000000010040431E r12=00000007FFFFCC30 r13=00000007FFFFCC50
r14=0000000000000000 r15=0000000000000002
rbp=00000007FFFFCAC0 rsp=00000007FFFFCA18
program=C:\Users\...\gdcv\gdcv_debug.exe, pid 2040, thread 
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame         Function      Args
0007FFFFCAC0  00010040AEA6 (000100406424, 0007FFFFCAC0, 00010040153C, 000A00000490) gdcv_debug.exe+0xAEA6
0007FFFFCAC0  000000201170 (0007FFFFCAC0, 00010040153C, 000A00000490, 000000000010) 
0007FFFFCAC0  0007FFFFCB20 (00010040153C, 000A00000490, 000000000010, 000A00000355) 
0007FFFFCAC0  000100406424 (000000000010, 000A00000355, 0001800AC2C4, 000000000000) gdcv_debug.exe+0x6424
0007FFFFCAC0  00010040153C (0007FFFFCC30, 000000000000, 0001800480D4, 0007FFFFCC50) gdcv_debug.exe+0x153C
0007FFFFCD30  000180048140 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x8140
0007FFFFFFF0  000180045C86 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x5C86
0007FFFFFFF0  000180045D34 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x5D34
End of stack trace

pecheny avatar May 16 '23 15:05 pecheny

Thank you. I did not think it can be compiled at all. I do not have any experience with windows programming, maybe the reason it does not work is due to difference between windows and linux paths.

Anyway, in my free time i am rewriting the program and hope that i'll fix this issue in the new version.

konstare avatar May 17 '23 04:05 konstare