I have this C code that includes lzma.h
and uses only three functions from the liblzma-devel : lzma_stream_decoder
, lzma_code
, and lzma_end
. Pretty standard. The code compiled well until linking, which is when I got the following error:
$ gcc -llzma example.c -o example.exe
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccrO7vP5.o:example.c:(.text+0x2fc): undefined reference to `lzma_stream_decoder'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccrO7vP5.o:example.c:(.text+0x44f): undefined reference to `lzma_code'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccrO7vP5.o:example.c:(.text+0x591): undefined reference to `lzma_end'
collect2: error: ld returned 1 exit status
I have the liblzma.dll.a
file in my C:\cygwin64\lib folder. I also have liblzma-devel
version 5.2.6-1 installed. Passing -L/lib
did not work.
Does anyone know how I can satisfy this linker?