Opened 3 days ago
#11242 new defect
Incorrect suffix in `configure` for static builds on Windows causes lib not found
Reported by: | violet | Owned by: | |
---|---|---|---|
Priority: | critical | Component: | build system |
Version: | git-master | Keywords: | Build system; Win32; Static build; Suffix |
Cc: | violet | Blocked By: | |
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | yes |
Description
Summary of the bug:
How to reproduce:
In the ffmpeg/configure, static builds on win10 msys2 always have linux-style ".a" suffix, e.g. "libavcodec.a", rather than msvc-style ".lib" suffix.
When compiling libavcodec.a
with other libs, This linux-style suffix breaks VS2022's auto processing, and always causes lib-not-found error.
After digging into ffmpeg/configure, I found this error is just caused by LIBSUF
variable not set correctly for differnet target-os.
Thus, this issue can be fixed as follows:
In ffmpeg/configure -> case $target_os in
-> win32|win64)
The original code looks like:
SLIBPREF="" SLIBSUF=".dll"
By simply add one line of code, this issue can be solved:
SLIBPREF="" LIBSUF=".lib" # FIX LIBSUF here SLIBSUF=".dll"
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.