i can't compilie ffmpeg source in Visual Studio 2010

Questions that occur when trying to compile FFmpeg.
Post Reply
sgissb1
Posts: 1
Joined: Wed Jan 13, 2016 9:44 am

i can't compilie ffmpeg source in Visual Studio 2010

Post by sgissb1 » Wed Jan 13, 2016 9:49 am

hi all,
i make build environment by step by step with manual (https://www.ffmpeg.org/platform.html#Mi ... or-Windows)
but my compilie have a lot of error.like this:

$ make
CC libavdevice/avdevice.o
avdevice.c
libavdevice/avdevice.c(38) : error C2059: ▒﷨▒▒▒▒:▒▒.▒▒
libavdevice/avdevice.c(40) : error C2059: ▒﷨▒▒▒▒:▒▒,▒▒
libavdevice/avdevice.c(42) : error C2059: ▒﷨▒▒▒▒:▒▒,▒▒
libavdevice/avdevice.c(44) : error C2059: ▒﷨▒▒▒▒:▒▒,▒▒
libavdevice/avdevice.c(46) : error C2059: ▒﷨▒▒▒▒:▒▒,▒▒
libavdevice/avdevice.c(48) : error C2059: ▒﷨▒▒▒▒:▒▒,▒▒
libavdevice/avdevice.c(50) : error C2059: ▒﷨▒▒▒▒:▒▒,▒▒
libavdevice/avdevice.c(52) : error C2059: ▒﷨▒▒▒▒:▒▒,▒▒
libavdevice/avdevice.c(54) : error C2059: ▒﷨▒▒▒▒:▒▒,▒▒
libavdevice/avdevice.c(56) : error C2059: ▒﷨▒▒▒▒:▒▒}▒▒
libavdevice/avdevice.c(85) : fatal error C1903: ▒޷▒▒▒▒▒ǰ▒Ĵ▒▒▒▒лָ▒▒▒▒▒▒▒ֹͣ▒▒▒▒
common.mak:57: recipe for target 'libavdevice/avdevice.o' failed
make: *** [libavdevice/avdevice.o] Error 2

gawik
Posts: 6
Joined: Tue Mar 24, 2015 9:11 am

Re: i can't compilie ffmpeg source in Visual Studio 2010

Post by gawik » Fri Apr 21, 2017 11:04 am

Hi I've got the same error with Visual Studio 2012.
Did you found a solution ?
Thanks

gawik
Posts: 6
Joined: Tue Mar 24, 2015 9:11 am

Re: i can't compilie ffmpeg source in Visual Studio 2010

Post by gawik » Fri Apr 21, 2017 2:05 pm

Well I found a solution.

With Visual Studio 2012, when you call the command [cl 2>&1], the word "version" is written with a lowercase 'v' and the character between
the word "version" and the first digit was not a "space" character. It's a special character.
So In the shell script "configure", the variable "cl_major_ver" at line ~3550 was initialized with a empty value.
In that case, the script "configure" choose "cc_default = cl" instead of "cc_default = c99wrap cl" (see below the original code )

Code: Select all

	# Check whether the current MSVC version needs the C99 converter.
        # From MSVC 2013 (compiler major version 18) onwards, it does actually
        # support enough of C99 to build ffmpeg. Default to the new
        # behaviour if the regexp was unable to match anything, since this
        # successfully parses the version number of existing supported
        # versions that require the converter (MSVC 2010 and 2012).
        cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/Ip')
        if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
		    cc_default="cl"
        else
		    cc_default="c99wrap cl"
        fi
My solution was to update the script file "configure" by replace this code by this one :

Code: Select all

# Check whether the current MSVC version needs the C99 converter.
        # From MSVC 2013 (compiler major version 18) onwards, it does actually
        # support enough of C99 to build ffmpeg. Default to the new
        # behaviour if the regexp was unable to match anything, since this
        # successfully parses the version number of existing supported
        # versions that require the converter (MSVC 2010 and 2012).
        #cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
        #if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
		#    cc_default="cl"
        #else
		#    cc_default="c99wrap cl"
        #fi
	cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/Ip')
	if [ -z "$cl_major_ver" ] || [ $cl_major_ver -l 18 ]; then
        	cc_default="c99wrap cl"
        else
		cc_default="cl"
        fi
First I added the option 'I' at the end of sed command to be non sensitive case.
Secondly I change the if condition, because in case where the sed command not work, cl_major_ver is empty.

The best solution will be to improve the sed command :
- Replace '/p' by '/Ip' to be non-sensitive case
- Replace the space character between "version" and digit, by dot but I try it and it didn't work (I don't know why ?)

Post Reply