[Ffmpeg-devel] [PATCH] Cygwin vhook, always static avformat

Víctor Paesa wzrlpy
Wed Aug 2 15:45:42 CEST 2006


Hi,

> Does just adding
>
>   VHOOKFLAGS="-shared"
>
> and removing vhook=no from the Cygwin section help already?


I made your suggested changes, then
"./configure --enable-static- --disable-shared; make",
and I got this error:

gcc -fPIC -O3  -g -Wdeclaration-after-statement -Wall -Wno-switch -I..
-I/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg
-I/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/libavformat
-I/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/libavcodec
-I/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/libavutil -DHAVE_AV_CONFIG_H
`freetype-config --cflags`   -c -o null.o null.c
null.c:1: warning: -fPIC ignored for target (all code is position
independent)
gcc -Wl,--warn-common   -rdynamic -export-dynamic -Wl,--as-needed
-Wl,-rpath-link,/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/libavcodec
-Wl,-rpath-link,/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/libavformat
-Wl,-rpath-link,/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/libavutil
-lImlib2 `freetype-config --libs` -g -o null.dll -shared null.o
gcc: unrecognized option `-rdynamic'
null.o: In function `Configure':
/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook/null.c:40: undefined
reference to `_av_mallocz'
null.o: In function `Process':
/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook/null.c:56: undefined
reference to `_avpicture_get_size'
/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook/null.c:57: undefined
reference to `_av_malloc'
/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook/null.c:59: undefined
reference to `_avpicture_fill'
/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook/null.c:60: undefined
reference to `_img_convert'
/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook/null.c:71: undefined
reference to `_img_convert'
/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook/null.c:76: undefined
reference to `_av_free'
null.o: In function `Release':
/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook/null.c:33: undefined
reference to `_av_free'
collect2: ld returned 1 exit status
make[1]: *** [null.dll] Error 1
rm null.o
make[1]: Leaving directory
`/home/wzrlpy/src/FFMpeg-20060729-5847/ffmpeg/vhook'
make: *** [videohook] Error 2

The errors are the same after
"make distclean; ./configure --enable-shared --disable-static; make".

The reason is that WIN32 does not allow undefined symbols during linking.

These symbols might be defined by:

a) Adding the av[ucf]* libraries as VHOOKLIBS (the
ffmpeg.cygwin.vhook.6.patch way)

b) Creating a .def for the _av_mallocz, _avpicture_get_size, etc. that
exist in ffmpeg.exe (static build), then adding
that .def to the linking steps in vhooks.

c) Using __declspec(dllimport) (a.ka. FF_IMPORT_ATTR) somehow, somewhere
in vhooks (shared libraries builds).

I believe that (a) is the solution that minimizes changes and is more
portable.

I applied the changes to SVN-5847, but the changes to the build system in
r5860, r5862, r5869, r5872, r5874, r5875, r5882, r5884
are not adding libraries to the vhook subsystem, so I believe it won't make
a difference if I apply it to current SVN.

I will rebase to current SVN this evening and I will confirm it.

Regards,
V?ctor Paesa




More information about the ffmpeg-devel mailing list