-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[<liblzma>] <add LZMA_API_STATIC in lzma.h for linking static build of liblzma> #43803
Comments
@alwendya I did not encounter any errors when testing the usage on |
Thanks @Mengna-Li ,
When I try to run this function, I get linker error searching from all function with |
@Mengna-Li API defines need to be burned in for MSBuild consumers or other builds which don't use CMake or pkg-config. |
Is your feature request related to a problem? Please describe.
I had problem using liblzma in static inside my program with the triplet
x64-windows-static-md
.If I look inside
lzma.h
main header, it saysI defined
LZMA_API_STATIC
before includinglzma.h
but I got linking error telling it doesn't find any function.In details it is looking for lzma function with the prefix
__imp_
(for example__imp_lzma_stream_encoder_mt
forlzma_stream_encoder_mt
function) but since I'm in static mode, it shouldn't.I looked further in lzma.h header and there is no usage of the
LZMA_API_STATIC
flag.I looked in the original
lzma.h
file from liblzma github repository and inside their files, they use the static flag forLZMA_API_IMPORT
.VCPGK
lzma.h
extract :Original
lzma.h
extract :I switched
LZMA_API_IMPORT
from originallzma.h
and now it worksProposed solution
Replace !1 by !defined(LZMA_API_STATIC) in
lzma.h
VCPGK
lzma.h
extract :Original
lzma.h
extract :Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: