[FFmpeg-trac] #282(build system:closed): undefined reference to `_avdevice_register_all'
FFmpeg
trac at avcodec.org
Tue Nov 20 21:57:33 CET 2012
#282: undefined reference to `_avdevice_register_all'
-------------------------------------+-------------------------------------
Reporter: KSHawkEye | Owner: michael
Type: defect | Status: closed
Priority: critical | Component: build
Version: git | system
Keywords: undefined | Resolution: invalid
reference avdevice_register_all | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by reimar):
I do not see any reasonable explanation, and I cannot reproduce it.
However what seems to happen according to the reported facts is that
avdevice_register_all is not exported from avdevice-54.dll.
You can check that by running objdump -x libavdevice/avdevice-54.dll
The interesting part is "The Export Tables (interpreted .edata section
contents)"
If it was generated correctly, it should have a part looking like this:
{{{
[Ordinal/Name Pointer] Table
[ 0] avdevice_configuration
[ 1] avdevice_license
[ 2] avdevice_register_all
[ 3] avdevice_version
}}}
The previous suggested hack of adding declspec(dllexport) should not be
necessary, the information that these and only these functions should be
exported comes from libavdevice/libavdevice.ver.
That file in turn is generated from libavdevice/libavdevice.v.
It is specified via the -Wl,--version-script,libavdevice/libavdevice.ver
option when linking the dll file.
This compilation step also generates a libavdevice/avdevice-54.def which
should look like this:
{{{
EXPORTS
avdevice_configuration @1
avdevice_license @2
avdevice_register_all @3
avdevice_version @4
}}}
There is one very crazy theory how this could go wrong with SDL: Without
setting -DDECLSPEC SDL will use dllspec(dllexport) and dllspec(dllimport)
instead of version/def/dll.a files.
This might mean that the linker ends up with some symbols being marked up
via dllspec while also getting a version script, and due to some bug it
might end up ignoring the version script.
It seems very unlikely though, but if you want to investigate you will
probably want to experiment with the commandline used to link the avdevice
dll.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/282#comment:28>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list