Het lijkt erop van niet, aangezien ik nog heb geprobeerd om ld aan te sturen met de --start-group/--end-group opties. Hiermee kun je ld laten zoeken binnen een bepaalde groep archives, om zo circular references op te lossen. Dit leverde alleen maar meer undefined references op...
de -s optie schrijft de index in het archive, niet strikt noodzakelijk, heb de optie erbij gezet maar het maakte niks uit.
Wat is eigenlijk de reden dat je niet -static gebruikt?
-static forceert het gebruik van de statische variant van een lib boven de dynamische. Aangezien ik geen dynamische versie van SDL_ffmpeg heb lijkt me deze optie niet noodzakelijk.
Het probleem is dat ik nog geen stap dichterbij ben gekomen
hier de updated output.
$ make all
gcc -Iinclude/ -I/c/lib/SDL-1.2.12/include -L/c/lib/SDL-1.2.12/lib -Llib -lmingw32 -lSDLmain -lSDL -lSDL_ffmpeg src/example.c -o bin/SDL_ffmpeg_example
[bla]/ccu2aaaa.o:example.c:(.text+0x1a): undefined reference to `SDL_ffmpegGetAudioFrame'
[bla]/ccu2aaaa.o:example.c:(.text+0x4d): undefined reference to `SDL_ffmpegGetAudioFrame'
[bla]/ccu2aaaa.o:example.c:(.text+0xc3): undefined reference to `SDL_ffmpegReleaseAudio'
[bla]/ccu2aaaa.o:example.c:(.text+0x14e): undefined reference to `SDL_ffmpegOpen'
[bla]/ccu2aaaa.o:example.c:(.text+0x197): undefined reference to `SDL_ffmpegGetAudioStream'
[bla]/ccu2aaaa.o:example.c:(.text+0x236): undefined reference to `SDL_ffmpegGetVideoStream'
[bla]/ccu2aaaa.o:example.c:(.text+0x2dc): undefined reference to `SDL_ffmpegSelectVideoStream'
[bla]/ccu2aaaa.o:example.c:(.text+0x2ef): undefined reference to `SDL_ffmpegSelectAudioStream'
[bla]/ccu2aaaa.o:example.c:(.text+0x30a): undefined reference to `SDL_ffmpegGetAudioSpec'
[bla]/ccu2aaaa.o:example.c:(.text+0x326): undefined reference to `SDL_ffmpegGetVideoSize'
[bla]/ccu2aaaa.o:example.c:(.text+0x348): undefined reference to `SDL_SetVideoMode'
[bla]/ccu2aaaa.o:example.c:(.text+0x385): undefined reference to `SDL_OpenAudio'
[bla]/ccu2aaaa.o:example.c:(.text+0x3b5): undefined reference to `SDL_ffmpegStartDecoding'
[bla]/ccu2aaaa.o:example.c:(.text+0x3c1): undefined reference to `SDL_PauseAudio'
[bla]/ccu2aaaa.o:example.c:(.text+0x3dd): undefined reference to `SDL_PollEvent'
[bla]/ccu2aaaa.o:example.c:(.text+0x402): undefined reference to `SDL_PumpEvents'
[bla]/ccu2aaaa.o:example.c:(.text+0x414): undefined reference to `SDL_GetMouseState'
[bla]/ccu2aaaa.o:example.c:(.text+0x42a): undefined reference to `SDL_ffmpegGetDuration'
[bla]/ccu2aaaa.o:example.c:(.text+0x467): undefined reference to `SDL_ffmpegSeek'
[bla]/ccu2aaaa.o:example.c:(.text+0x47a): undefined reference to `SDL_ffmpegPause'
[bla]/ccu2aaaa.o:example.c:(.text+0x48a): undefined reference to `SDL_ffmpegGetVideoFrame'
[bla]/ccu2aaaa.o:example.c:(.text+0x4b8): undefined reference to `SDL_UpperBlit'
[bla]/ccu2aaaa.o:example.c:(.text+0x4ca): undefined reference to `SDL_ffmpegReleaseVideo'
[bla]/ccu2aaaa.o:example.c:(.text+0x4d5): undefined reference to `SDL_Flip'
[bla]/ccu2aaaa.o:example.c:(.text+0x4e1): undefined reference to `SDL_Delay'
[bla]/ccu2aaaa.o:example.c:(.text+0x4f1): undefined reference to `SDL_ffmpegFree'
collect2: ld returned 1 exit status
make: *** [SDL_ffmpeg_example] Error 1
Wat ik echt niet kan verklaren, is dat ld zeurt over SDL_ffmpeg* calls, terwijl ik nu net alléén deze calls in de library heb gezet... nm is het overigens met me eens:
$ nm lib/libSDL_ffmpeg.a
SDL_ffmpeg.o:
00000000 b .bss
00000000 d .data
00000000 r .rdata
00000000 t .text
00000000 B _FFMPEG_init_was_called
U _SDL_CreateRGBSurface
U _SDL_CreateSemaphore
U _SDL_CreateThread
U _SDL_Delay
U _SDL_FreeSurface
U _SDL_GetTicks
U _SDL_SemPost
U _SDL_SemWait
U _SDL_WaitThread
00000000 T _SDL_ffmpegCreateFile
00000b63 T _SDL_ffmpegDecodeThread
0000108e T _SDL_ffmpegFlush
000000fb T _SDL_ffmpegFree
000012bc T _SDL_ffmpegGetAudioFrame
00001536 T _SDL_ffmpegGetAudioSpec
000009df T _SDL_ffmpegGetAudioStream
000015e6 T _SDL_ffmpegGetDuration
00001512 T _SDL_ffmpegGetPosition
00001754 T _SDL_ffmpegGetState
000007ce T _SDL_ffmpegGetVideoFrame
0000161b T _SDL_ffmpegGetVideoSize
00000a67 T _SDL_ffmpegGetVideoStream
00000124 T _SDL_ffmpegOpen
0000171d T _SDL_ffmpegPause
00001465 T _SDL_ffmpegReleaseAudio
0000097c T _SDL_ffmpegReleaseVideo
00000f0c T _SDL_ffmpegSeek
00001062 T _SDL_ffmpegSeekRelative
00000a26 T _SDL_ffmpegSelectAudioStream
00000aae T _SDL_ffmpegSelectVideoStream
00000aef T _SDL_ffmpegStartDecoding
00000b23 T _SDL_ffmpegStopDecoding
000016b5 T _SDL_ffmpegValidAudio
000016e9 T _SDL_ffmpegValidVideo
U ___divdi3
U __imp___iob
U _av_find_stream_info
00000ee7 t _av_free_packet
U _av_open_input_file
000007c1 t _av_q2d
U _av_read_frame
U _av_register_all
U _av_seek_frame
U _avcodec_alloc_frame
U _avcodec_decode_audio2
U _avcodec_decode_video
U _avcodec_find_decoder
U _avcodec_flush_buffers
U _avcodec_open
U _avpicture_fill
U _avpicture_get_size
U _fprintf
U _free
0000175f T _getAudioFrame
00001924 T _getVideoFrame
U _malloc
U _memcpy
U _memmove
U _memset
U _sws_getContext
U _sws_scale
De enige verklaring die ik daarvoor dus kon bedenken was de circular reference, maar zoals vermeld heb ik dit ook geprobeerd en dat liep op niets uit.
-( archives -)
--start-group archives --end-group
The archives should be a list of archive files. They may be either explicit file names, or `-l' options. The specified archives are searched repeatedly until no new undefined references are created. Normally, an archive is searched only once in the order that it is specified on the command line. If a symbol in that archive is needed to resolve an undefined symbol referred to by an object in an archive that appears later on the command line, the linker would not be able to resolve that reference. By grouping the archives, they all be searched repeatedly until all possible references are resolved. Using this option has a significant performance cost. It is best to use it only when there are unavoidable circular references between two or more archives.
Ik kan me niet voorstellen dat een static library maken zoveel moeite moet kosten..
Ik zal dus vast wel wat over het hoofd zien, maar wat