Opened 13 years ago

Closed 13 years ago

#256 closed defect (fixed)

FFmpeg fails to build after SDL output device addition

Reported by: Kyle Owned by:
Priority: important Component: build system
Version: git-master Keywords: sdl
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

The current FFmpeg fails to build due to the new SDL output device additions.

FFmpeg fails at make with:

ffmpeg.c:4474:5: error: no previous prototype for ‘SDL_main’

I should note that SDL is built and have worked with previous versions.

Attachments (1)

patchmainmingw32.diff (740 bytes ) - added by Carl Eugen Hoyos 13 years ago.

Download all attachments as: .zip

Change History (12)

in reply to:  description comment:1 by Kyle, 13 years ago

Replying to KSHawkEye:

The current FFmpeg fails to build due to the new SDL output device additions.

FFmpeg fails at make with:

ffmpeg.c:4474:5: error: no previous prototype for ‘SDL_main’

I should note that SDL is built and have worked with previous versions.

Correction: "I should note that SDL is built and have worked with previous versions." should read: "I should note that SDL is built and has worked with previous versions."

Also, this is a for a Windows build.

Lastly, the git commit I tested on was: f6a8ce98a7bce601a7db4a8f2a615822dc8f71bd

comment:2 by Carl Eugen Hoyos, 13 years ago

Component: undeterminedbuild system
Keywords: sdl added
Priority: criticalimportant
Status: newopen

Please add the complete, uncut output of

$ make V=1 ffmpeg.o

comment:3 by Carl Eugen Hoyos, 13 years ago

And please attach ffmpeg.d (after running above command).

comment:4 by Kyle, 13 years ago

i686-w64-mingw32-gcc -I. -I"/home/kyle/software/ffmpeg/source/ffmpeg-git" -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -I/home/kyle/software/ffmpeg/packages/sdl/sdl-1.2.14-win32/include -I/home/kyle/software/ffmpeg/packages/bzlib/bzlib-1.0.6-win32/include -I/home/kyle/software/ffmpeg/packages/freetype/freetype-2.4.4-win32/include -I/home/kyle/software/ffmpeg/packages/frei0r/frei0r-1.3-win32/include -I/home/kyle/software/ffmpeg/packages/gsm/gsm-1.0.13-3-win32/include -I/home/kyle/software/ffmpeg/packages/lame/lame-3.98.4-win32/include -I/home/kyle/software/ffmpeg/packages/opencore-amr/opencore-amr-0.1.2-win32/include -I/home/kyle/software/ffmpeg/packages/openjpeg/openjpeg-1.4-win32/include -I/home/kyle/software/ffmpeg/packages/speex/speex-1.2rc1-win32/include -I/home/kyle/software/ffmpeg/packages/theora/theora-1.1.1-win32/include -I/home/kyle/software/ffmpeg/packages/vorbis/vorbis-1.3.2-win32/include -I/home/kyle/software/ffmpeg/packages/libvpx/libvpx-0.9.6-win32/include -I/home/kyle/software/ffmpeg/packages/polarssl/polarssl-0.14.3-win32/include -I/home/kyle/software/ffmpeg/packages/rtmpdump/librtmp-git-6155179b-win32/include -I/home/kyle/software/ffmpeg/packages/orc/orc-0.4.11-win32/include -I/home/kyle/software/ffmpeg/packages/schroedinger/schroedinger-1.0.10-win32/include -I/home/kyle/software/ffmpeg/packages/libogg/libogg-1.2.2-win32/include -I/home/kyle/software/ffmpeg/packages/x264/x264-git-c1e60b90-win32/include -I/home/kyle/software/ffmpeg/packages/xavs/xavs-r51-win32/include -I/home/kyle/software/ffmpeg/packages/xvid/xvid-1.3.2-win32/include -I/home/kyle/software/ffmpeg/packages/zlib/zlib-1.2.5-win32/include   -std=c99 -fno-common -fomit-frame-pointer -I/home/kyle/software/ffmpeg/packages/freetype/freetype-2.4.4-win32/include/freetype2 -I/home/kyle/software/ffmpeg/packages/freetype/freetype-2.4.4-win32/include -I/home/kyle/software/ffmpeg/packages/rtmpdump/librtmp-git-6155179b-win32/include -I/home/kyle/software/ffmpeg/packages/schroedinger/schroedinger-1.0.10-win32/include/schroedinger-1.0 -I/home/kyle/software/ffmpeg/packages/orc/orc-0.4.11-win32/include/orc-0.4 -D_GNU_SOURCE=1 -Dmain=SDL_main -I/home/kyle/software/ffmpeg/packages/sdl/sdl-1.2.14-win32/include/SDL -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes          -MMD -MF ffmpeg.d -MT ffmpeg.o -c -o ffmpeg.o /home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c
In file included from /home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:45:0:
/home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/os_support.h:34:0: warning: "lseek" redefined
/home/kyle/software/mingw-w64/test-script/mingw-w64-i686/lib/gcc/i686-w64-mingw32/4.5.3/../../../../i686-w64-mingw32/include/io.h:336:0: note: this is the location of the previous definition
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c: In function ‘term_exit’:
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:444:5: warning: zero-length ms_printf format string
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c: In function ‘opt_input_file’:
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:3244:5: warning: ‘sample_rate’ is deprecated (declared at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/avformat.h:232)
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:3245:5: warning: ‘channels’ is deprecated (declared at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/avformat.h:233)
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:3248:5: warning: ‘width’ is deprecated (declared at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/avformat.h:234)
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:3249:5: warning: ‘height’ is deprecated (declared at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/avformat.h:235)
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:3250:5: warning: ‘pix_fmt’ is deprecated (declared at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/avformat.h:236)
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:3252:5: warning: ‘channel’ is deprecated (declared at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/avformat.h:237)
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:3253:5: warning: ‘standard’ is deprecated (declared at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/avformat.h:238)
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c: In function ‘opt_output_file’:
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:3951:5: warning: ‘av_set_parameters’ is deprecated (declared at /home/kyle/software/ffmpeg/source/ffmpeg-git/libavformat/avformat.h:1362)
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c: At top level:
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffmpeg.c:4474:5: error: no previous prototype for ‘SDL_main’
make: *** [ffmpeg.o] Error 1

I could not find ffmpeg.d I don't believe it was built.

comment:5 by Stefano Sabatini, 13 years ago

-Dmain=SDL_main in the compile flags looks like the culprit...

comment:6 by Carl Eugen Hoyos, 13 years ago

Could you please also test

$ make V=1 ffserver.o
$ make V=1 ffprobe.o

comment:7 by Kyle, 13 years ago

ffserver does not build on Windows.

ffprobe gave me the same error:

i686-w64-mingw32-gcc -I. -I"/home/kyle/software/ffmpeg/source/ffmpeg-git" -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -I/home/kyle/software/ffmpeg/packages/sdl/sdl-1.2.14-win32/include -I/home/kyle/software/ffmpeg/packages/bzlib/bzlib-1.0.6-win32/include -I/home/kyle/software/ffmpeg/packages/freetype/freetype-2.4.4-win32/include -I/home/kyle/software/ffmpeg/packages/frei0r/frei0r-1.3-win32/include -I/home/kyle/software/ffmpeg/packages/gsm/gsm-1.0.13-3-win32/include -I/home/kyle/software/ffmpeg/packages/lame/lame-3.98.4-win32/include -I/home/kyle/software/ffmpeg/packages/opencore-amr/opencore-amr-0.1.2-win32/include -I/home/kyle/software/ffmpeg/packages/openjpeg/openjpeg-1.4-win32/include -I/home/kyle/software/ffmpeg/packages/speex/speex-1.2rc1-win32/include -I/home/kyle/software/ffmpeg/packages/theora/theora-1.1.1-win32/include -I/home/kyle/software/ffmpeg/packages/vorbis/vorbis-1.3.2-win32/include -I/home/kyle/software/ffmpeg/packages/libvpx/libvpx-0.9.6-win32/include -I/home/kyle/software/ffmpeg/packages/polarssl/polarssl-0.14.3-win32/include -I/home/kyle/software/ffmpeg/packages/rtmpdump/librtmp-git-6155179b-win32/include -I/home/kyle/software/ffmpeg/packages/orc/orc-0.4.11-win32/include -I/home/kyle/software/ffmpeg/packages/schroedinger/schroedinger-1.0.10-win32/include -I/home/kyle/software/ffmpeg/packages/libogg/libogg-1.2.2-win32/include -I/home/kyle/software/ffmpeg/packages/x264/x264-git-c1e60b90-win32/include -I/home/kyle/software/ffmpeg/packages/xavs/xavs-r51-win32/include -I/home/kyle/software/ffmpeg/packages/xvid/xvid-1.3.2-win32/include -I/home/kyle/software/ffmpeg/packages/zlib/zlib-1.2.5-win32/include   -std=c99 -fno-common -fomit-frame-pointer -I/home/kyle/software/ffmpeg/packages/freetype/freetype-2.4.4-win32/include/freetype2 -I/home/kyle/software/ffmpeg/packages/freetype/freetype-2.4.4-win32/include -I/home/kyle/software/ffmpeg/packages/rtmpdump/librtmp-git-6155179b-win32/include -I/home/kyle/software/ffmpeg/packages/schroedinger/schroedinger-1.0.10-win32/include/schroedinger-1.0 -I/home/kyle/software/ffmpeg/packages/orc/orc-0.4.11-win32/include/orc-0.4 -D_GNU_SOURCE=1 -Dmain=SDL_main -I/home/kyle/software/ffmpeg/packages/sdl/sdl-1.2.14-win32/include/SDL -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes          -MMD -MF ffprobe.d -MT ffprobe.o -c -o ffprobe.o /home/kyle/software/ffmpeg/source/ffmpeg-git/ffprobe.c
/home/kyle/software/ffmpeg/source/ffmpeg-git/ffprobe.c:390:5: error: no previous prototype for ‘SDL_main’
make: *** [ffprobe.o] Error 1

by Carl Eugen Hoyos, 13 years ago

Attachment: patchmainmingw32.diff added

comment:8 by Carl Eugen Hoyos, 13 years ago

Could you test attached patch?

comment:9 by Stefano Sabatini, 13 years ago

Patch looks fine to me (indeed I didn't know we already use that trick in ffplay.c) if tested and works, thanks.

comment:10 by Kyle, 13 years ago

I can confirm that the patch does fix the issue.

comment:11 by Stefano Sabatini, 13 years ago

Analyzed by developer: set
Reproduced by developer: set
Resolution: fixed
Status: openclosed

Fixed in commit:

commit 25c32d082b1ab4c3567c09f707e75c8ac582806c
Author: Carl Eugen Hoyos <cehoyos@ag.or.at>
Date:   Fri Jun 3 13:30:27 2011 +0200

    cmdutils: move "#undef main" from ffplay.c to cmdutils.h
    
    On Windows/MinGW the SDL cflags re-define the main() function, which
    results in a linking error if the define is not undeffed.
    
    Since the addition of the SDL output device, SDL cflags are used also
    for compiling ffmpeg and ffprobe, so we need to move this trick from
    ffplay.c to a common header.
    
    Fix trac issue #256.
Note: See TracTickets for help on using tickets.