Opened 12 years ago

Closed 12 years ago

#999 closed defect (fixed)

error: 'wcscpy_instead_use_StringCbCopyW_or_StringCchCopyW' undeclared (first use in this function)

Reported by: Kyle Owned by:
Priority: critical Component: avdevice
Version: 0.10 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When trying to compile FFmpeg 0.10 with MinGW-w64 I get this error:

i686-w64-mingw32-gcc -I. -I/home/kyle/software/ffmpeg/source/ffmpeg-0.10/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -DHAVE_AV_CONFIG_H -std=c99 -fno-common -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes  -MMD -MF libavdevice/dshow_filter.d -MT libavdevice/dshow_filter.o -c -o libavdevice/dshow_filter.o /home/kyle/software/ffmpeg/source/ffmpeg-0.10/libavdevice/dshow_filter.c
/home/kyle/software/ffmpeg/source/ffmpeg-0.10/libavdevice/dshow_filter.c: In function 'libAVFilter_JoinFilterGraph':
/home/kyle/software/ffmpeg/source/ffmpeg-0.10/libavdevice/dshow_filter.c:149:9: error: 'wcscpy_instead_use_StringCbCopyW_or_StringCchCopyW' undeclared (first use in this function)
/home/kyle/software/ffmpeg/source/ffmpeg-0.10/libavdevice/dshow_filter.c:149:9: note: each undeclared identifier is reported only once for each function it appears in
/home/kyle/software/ffmpeg/source/ffmpeg-0.10/libavdevice/dshow_filter.c:149:34: warning: left-hand operand of comma expression has no effect [-Wunused-value]
/home/kyle/software/ffmpeg/source/ffmpeg-0.10/libavdevice/dshow_filter.c:149:15: warning: statement with no effect [-Wunused-value]
make: *** [libavdevice/dshow_filter.o] Error 1

Any ideas?

Change History (5)

comment:1 by Rafaël Carré, 12 years ago

You should apply the fix made in
http://git.videolan.org/?p=vlc.git;a=commitdiff;h=bb7509af051d8384b9266bcdb345c553f608559c#patch1

Using the secure versions would be better but mingw.org doesn't have them afaik.

comment:2 by Rafaël Carré, 12 years ago

Oops the important part is the 2nd diff: NO_DSHOW_STRSAFE

comment:3 by Michael Niedermayer, 12 years ago

if someone send me a patch or confirm that some change fixes it then ill apply it

Last edited 12 years ago by Michael Niedermayer (previous) (diff)

comment:4 by Rafaël Carré, 12 years ago

From 5cc6b4f59063eb19341ddc94999ef218fafaf5a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= <funman@videolan.org>
Date: Thu, 16 Feb 2012 17:15:59 -0500
Subject: [PATCH] dshow_filter: fix compilation with mingw-w64

Closes ticket #999
NO_DSHOW_STRSAFE asks dshow.h header to not use secure string function
replacements.
Using secure replacements would break mingw.org compatibility as they don't
declare/define those functions.
---
 libavdevice/dshow_filter.c |    1 +
 libavdevice/dshow_pin.c    |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavdevice/dshow_filter.c b/libavdevice/dshow_filter.c
index 64e8306..526e8b6 100644
--- a/libavdevice/dshow_filter.c
+++ b/libavdevice/dshow_filter.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define NO_DSHOW_STRSAFE
 #include "dshow.h"
 
 DECLARE_QUERYINTERFACE(libAVFilter,
diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c
index 5e14108..d4463f6 100644
--- a/libavdevice/dshow_pin.c
+++ b/libavdevice/dshow_pin.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define NO_DSHOW_STRSAFE
 #include "dshow.h"
 
 #include <stddef.h>
-- 
1.7.9
Last edited 12 years ago by Rafaël Carré (previous) (diff)

comment:5 by Michael Niedermayer, 12 years ago

Resolution: fixed
Status: newclosed

Patch applied
Thanks

Note: See TracTickets for help on using tickets.