[libav-bugs] [Bug 864] New: vs2015 build issue: vnsprintf macro conflict with microsoft's libraries

bugzilla at libav.org bugzilla at libav.org
Fri Jun 5 13:34:13 CEST 2015


https://bugzilla.libav.org/show_bug.cgi?id=864

            Bug ID: 864
           Summary: vs2015 build issue:  vnsprintf macro conflict with
                    microsoft's libraries
           Product: Libav
           Version: git HEAD
          Hardware: X86
                OS: Windows
            Status: NEW
          Severity: blocker
          Priority: ---
         Component: general
          Assignee: bugzilla at libav.org
          Reporter: ray at oneunified.net

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
    )

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-bugs/attachments/20150605/a016d7d3/attachment.html>


More information about the libav-bugs mailing list