Opened 8 years ago
Closed 8 years ago
#7642 closed defect (fixed)
Linker error in MSVC with --disable-everything --enable-shared
| Reported by: | Stephen E. Baker | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | undetermined |
| Version: | git-master | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
Summary of the bug:
For several years I have been compiling a minimal (smacker only) version of ffmpeg for packaging with CorsixTH (an open source game implementation.)
I use vcpkg with a custom portfile to compile ffmpeg. Since updating from 3.3.5 to 4.1 my minimal compile is working; but the regular compile still works.
How to reproduce:
./configure --toolchain=msvc --prefix=../../buildtrees/ffmpeg/src --enable-asm --enable-yasm --disable-doc --enable-debug --disable-ffmpeg --enable-runtime-cpudetect --disable-openssl --disable-ffplay --disable-ffprobe --disable-libx264 --disable-opencl --disable-lzma --extra-cflags=-DHAVE_UNISTD_H=0 --disable-static --enable-shared --extra-cflags=-MD --extra-cxxflags=-MD make -j6
Attachments (3)
Change History (17)
by , 8 years ago
| Attachment: | build-x86-windows-rel-out.log added |
|---|
by , 8 years ago
| Attachment: | build-x86-windows-rel-err.log added |
|---|
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Unfortunately, the ticket title does not match the configure line you provided.
Is the issue reproducible with ./configure --toolchain=msvc --disable-everything && make ffmpeg? Or with another simplified configure line?
Please confirm that you tested current FFmpeg git head, nothing else is supported here.
comment:3 by , 8 years ago
Using the latest git at this time (fccba32b4c4f16682b2c34a4c84449a84f91d4d9)
I am not able to reproduce using ./configure --toolchain=msvc --disable-everything; make or ./configure --toolchain=msvc --disable-everything --disable-programs; make
I am able to reproduce with ./configure --toolchain=msvc --disable-everything --enable-asm --enable-yasm --disable-doc --enable-debug --disable-ffmpeg --enable-runtime-cpudetect --disable-openssl --disable-ffplay --disable-ffprobe --disable-libx264 --disable-opencl --disable-lzma --extra-cflags=-DHAVE_UNISTD_H=0 --disable-static --enable-shared --extra-cflags=-MD --extra-cxxflags=-MD; make
I'm not sure what the minimal necessary set of configure options is, but I know that adding --disable-autodetect, or removing --disable-everything from the last example causes it to work.
comment:4 by , 8 years ago
I can reproduce with:
./configure --toolchain=msvc --disable-everything --disable-doc --enable-debug --disable-programs --enable-runtime-cpudetect --disable-libx264 --disable-static --enable-shared make
That's as far as I have time to take it tonight. If necessary I can spend some time later trying to get a true minimal set.
comment:5 by , 8 years ago
./configure --toolchain=msvc --disable-everything --enable-shared is the minimal set of flags to trigger the error.
In case it matters:
OS: Microsoft Windows [Version 10.0.17134.472]
Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26732.1 for x64
comment:6 by , 8 years ago
| Summary: | Linker error in MSVC with --disable-everything → Linker error in MSVC with --disable-everything --enable-shared |
|---|
comment:7 by , 8 years ago
Please run make V=1 ffmpeg.exe twice and provide the console output of the second run.
comment:9 by , 8 years ago
| Version: | unspecified → git-master |
|---|
comment:10 by , 8 years ago
Please test this patch:
diff --git a/configure b/configure
index 04d3417..a636939 100755
--- a/configure
+++ b/configure
@@ -3527,7 +3527,7 @@ cws2fws_extralibs="zlib_extralibs"
# libraries, in any order
avcodec_deps="avutil"
-avcodec_suggest="libm"
+avcodec_suggest="libm ole32"
avcodec_select="null_bsf"
avdevice_deps="avformat avcodec avutil"
avdevice_suggest="libm"
@@ -3554,7 +3554,7 @@ ffmpeg_deps="avcodec avfilter avformat"
ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
null_filter
trim_filter"
-ffmpeg_suggest="ole32 psapi shell32"
+ffmpeg_suggest="psapi shell32"
ffplay_deps="avcodec avformat swscale swresample sdl2"
ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
ffplay_suggest="shell32"
comment:12 by , 8 years ago
Please confirm that with this patch applied, static compilation still works: ./configure --disable-everything && make ffmpeg.exe
comment:14 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Should be fixed in 4ec2daf0de1a30bdeffbeffefcb7211e96c04980.



From build-x86-windows-rel-out.log:
dxva2.o : error LNK2019: unresolved external symbol impCoTaskMemFree@4 referenced in function _dxva2_create_decoder
libavcodec/avcodec-58.dll : fatal error LNK1120: 1 unresolved externals