[libav-bugs] Building libav with VS2015

Raymond Burkholder ray at oneunified.net
Thu Jun 4 21:39:04 CEST 2015


I was following along the build instructions for VS in section 4.2 at
http://www.libav.org/platform.html.

Visual Studio 2015 must have changed stdio.h somehow.  I see the macro
redefinition in the make lines, and somehow stdio.h doesn't like it.  

Is there a work around?

This is the build message:

$ make V=1
cl -nologo -I. -I. -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_WIN32_WINNT=0x0502 -Dstrtod=avpriv_strtod
-Dsnprintf=avpriv_snprintf -D_snprintf=avpriv_snprintf
-Dvsnprintf=avpriv_vsnprintf -DHAVE_AV_CONFIG_H -I. -I. -D_ISOC99_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_WIN32_WINNT=0x0502
-Dstrtod=avpriv_strtod -Dsnprintf=avpriv_snprintf
-D_snprintf=avpriv_snprintf -Dvsnprintf=avpriv_vsnprintf -DHAVE_AV_CONFIG_H
-nologo -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline
-FIstdlib.h -Dstrtoll=_strtoi64    -Z7 -W4 -wd4244 -wd4127 -wd4018 -wd4389
-wd4146 -wd4057 -wd4204 -wd4706 -wd4305 -wd4152 -wd4324 -we4013 -wd4100
-wd4214 -wd4273 -wd4554 -wd4701 -O2   -Oy-  -showIncludes -Zs
libavdevice/alldevices.c 2>&1 | awk '/including/ { sub(/^.*file: */, "");
gsub(/\\/, "/"); if (!match($0, / /)) print "libavdevice/alldevices.o:", $0
}' > libavdevice/alldevices.d
cl -I. -I. -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_WIN32_WINNT=0x0502 -Dstrtod=avpriv_strtod -Dsnprintf=avpriv_snprintf
-D_snprintf=avpriv_snprintf -Dvsnprintf=avpriv_vsnprintf -DHAVE_AV_CONFIG_H
-nologo -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline
-FIstdlib.h -Dstrtoll=_strtoi64    -Z7 -W4 -wd4244 -wd4127 -wd4018 -wd4389
-wd4146 -wd4057 -wd4204 -wd4706 -wd4305 -wd4152 -wd4324 -we4013 -wd4100
-wd4214 -wd4273 -wd4554 -wd4701 -O2   -Oy-   -c -Folibavdevice/alldevices.o
libavdevice/alldevices.c
alldevices.c
C:\Program Files (x86)\Windows
Kits\10\include\10.0.10056.0\ucrt\stdio.h(1419): warning C4005: 'vsnprintf':
macro redefinition
C:\Program Files (x86)\Windows
Kits\10\include\10.0.10056.0\ucrt\stdio.h(1419): note: command-line
arguments:  see previous definition of 'vsnprintf'
C:\Program Files (x86)\Windows
Kits\10\include\10.0.10056.0\ucrt\stdio.h(1421): fatal error C1189: #error:
Macro definition of vsnprintf conflicts with Standard Library function
declaration
Makefile:44: recipe for target 'libavdevice/alldevices.o' failed
make: *** [libavdevice/alldevices.o] Error 2

These are the relevant lines in stdio.h:

#if defined vsnprintf
    // This definition of vsnprintf will generate "warning C4005:
'vsnprintf': macro
    // redefinition" with a subsequent line indicating where the previous
definition
    // of vsnprintf was.  This makes it easier to find where vsnprintf was
defined.
    #pragma warning(push, 1)
    #pragma warning(1: 4005)
    #define vsnprintf Do not define vsnprintf as a macro
    #pragma warning(pop)
    #error Macro definition of vsnprintf conflicts with Standard Library
function declaration
#endif

_Success_(return >= 0)
_Check_return_opt_
_CRT_STDIO_INLINE int __CRTDECL vsnprintf(
    _Out_writes_(_BufferCount)    char*       const _Buffer,
    _In_                          size_t      const _BufferCount,
    _In_z_ _Printf_format_string_ char const* const _Format,
                                  va_list           _ArgList
    )





-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the libav-bugs mailing list