[FFmpeg-devel] [PATCH] undef main when using SDL with MSVC toolchain

Marton Balint cus at passwd.hu
Sat May 17 13:12:12 CEST 2014


On Sat, 17 May 2014, John Peebles wrote:

> I found another place where checking __MINGW32__ should be replaced with
> checking _WIN32 (in ffplay.c) and have updated the patch to fix this too.
>

LGTM, thanks. I will merge this patch to my tree, and will ask Michael to 
merge it from there.

Regards,
Marton

>
> On Fri, May 16, 2014 at 10:51 PM, John Peebles <johnpeeb at gmail.com> wrote:
>
>> Attached is a new patch with the check for MINGW32 dropped.
>>
>>
>> On Fri, May 16, 2014 at 10:44 PM, Timothy Gu <timothygu99 at gmail.com>wrote:
>>
>>> On May 16, 2014 7:34 PM, "John Peebles" <johnpeeb at gmail.com> wrote:
>>>>
>>>> On windows, the SDL library headers redefine main as SDL_main, which
>>> would
>>>> break the build off ffplay since there is no entry point when linking.
>>> To
>>>> fix this, cmdutils.h includes the lines
>>>>
>>>> #ifdef __MINGW32__
>>>> #undef main /* We don't want SDL to override our main() */
>>>> #endif
>>>>
>>>> However, MINGW32 is not defined when doing a build with the MSVC
>>> toolchain.
>>>> This causes a linker error when trying to build ffplay using the MSVC
>>>> toolchain. The included patch adds an additional check for the MSVC
>>>> compiler and undefines main if we are using it, fixing the linker error.
>>>
>>> I'm pretty sure MinGW defines _WIN32 too so you can drop the check for it.
>>>
>>> Timothy
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>
>>
>


More information about the ffmpeg-devel mailing list