<br><br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><div class="im">
<blockquote type="cite"><br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
> I have got that to build, however compared to builds<br>
> from the zeranoe site (and also builds I have asked a<br>
> friend of mine to make for me using mingw with gcc),<br>
> I always end up with seeking problems.<br>
<br>
</div>
This is surprising.<br>
Are you sure that you are testing the same versions?<br>
</blockquote>
<div><br>
</div>
<div>I have downloaded the zeranoe build marked as 1.1.3 and I
also got <a href="http://ffmpeg.org/releases/ffmpeg-1.1.3.tar.bz2" target="_blank">http://ffmpeg.org/releases/ffmpeg-1.1.3.tar.bz2</a>
and built that myself.. so I would say it's the same version.
However I got the same problem with previous versions too
(tried 1.0.1, and 1.1 for example). </div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Did you try to disable optimizations?<br>
<div><br>
</div>
</blockquote>
<div>For some reason I get build errors as soon as I
use --disable-optimizations:</div>
<div><br>
</div>
<div>
<div><font color="#000099">LD<span style="white-space:pre-wrap"> </span>libavutil/avutil-52.dll</font></div>
<div><font color="#000099"> Creating library
libavutil/avutil.lib and object libavutil/avutil.exp</font></div>
<div><font color="#000099">cpu.o : error LNK2019: unresolved
external symbol _ff_get_cpu_flags_ppc referenced in
function _av_get_cpu_flags</font></div>
<div><font color="#000099">cpu.o : error LNK2019: unresolved
external symbol _ff_get_cpu_flags_arm referenced in
function _av_get_cpu_flags</font></div>
<div><font color="#000099">libavutil/avutil-52.dll : fatal
error LNK1120: 2 unresolved externals</font></div>
<div><font color="#000099">make: *** [libavutil/avutil-52.dll]
Error 1</font></div>
</div>
<div><br>
</div>
<div>If I don't disable optimizations I don't get that and it
builds fine... but no idea about that (I have never really
looked into the ffmpeg code except for the public headers)</div>
<div><br>
</div>
</div>
</blockquote>
<br>
<br></div>
Parts of ffmpeg source code assume the compiler will remove the body
of a conditional if the condition is always false, for example from
libavutil.c/av_get_cpu_flags():<br>
<br>
int av_get_cpu_flags(void)<br>
{<br>
if (checked)<br>
return flags;<br>
<br>
if (ARCH_ARM) flags = ff_get_cpu_flags_arm();<br>
if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();<br>
if (ARCH_X86) flags = ff_get_cpu_flags_x86();<br>
<br>
checked = 1;<br>
return flags;<br>
}<br>
<br>
<br>
If ARCH_ARM is the constant 0, the code assumes this reference to
ff_get_cpu_flags_arm() will disappear. Treats that as an
optimization, so if you turn off optimizations, the compiler will
generate code to call ff_get_cpu_flags_arm, but that function won't
exist if ARCH_ARM is false.<br>
<br>
To get around that, I've used flags like these to compile a less
optimized version for testing purposes:<br>
<br>
--toolchain=msvc --optflags='-Zi -Og -Oy- -arch:SSE2'
--extra-cflags='-Gy -MDd' --extra-ldflags='-OPT:REF -DEBUG -VERBOSE'
--enable-shared <br>
<br>
I've been using VC10. The thing that's handy for me is that it
generates .pdb files (via the -Zi flag) and I can mostly step
through code with the VC10 debugger.<br>
<br>
I had to modify the config.mak to get rid of some conflicting flags,
running the configuration script would add -Z7 (which contradicts
-Zi). It also would add -Oy which is the opposite of -Oy-, so I
manually removed it.<br>
<br>
--Johno<br>
<br>
</div>
</blockquote></div><br><div>I have had some time to play around with the configure (but please bear in mind that this was my first time ever modifying a configure, so I am not quite sure these things make sense - but please feel free to correct me, am happy to learn more about this!). </div>
<div><br></div><div>Anyway, my goal was to come to a configuration as described by John above, so that I can step through code with the MSVC debugger, and so far seems to work (ie compiled fine, and also seems can debug, but need to test more, but probably only after the weekend)</div>
<div><br></div><div>I tried this on the 1.2 release, with the following configuration options:</div><div><div>--prefix=<my project folder></div><div>--disable-encoders</div><div>--disable-muxers</div><div>--enable-hwaccels</div>
<div>--enable-dxva2</div><div>--enable-shared</div><div>--disable-static</div><div>--toolchain=msvc</div><div>--enable-small</div><div>--disable-optimizations</div><div>--enable-debug=3 </div></div><div><br></div><div>I don't need encoders or muxers, so I skipped those, I enabled dxva2 (although it seems it gets enabled by default anyway, not sure though), I used msvc toolchain with debug enabled, and optimizations disabled but enabled small (that might be a bit misleading as it leads to -O1 -Oy- which is an optimization)</div>
<div><br></div><div>Anyway, please see below my changes for the configure, as I said I don't know if they are really "correct" or might have side effects under other circumstances, but at least for me it worked to compile without getting any errors - feedback welcome!<br>
</div><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Around line 2430:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">added OPT:REF, DEBUG, and VERBOSE options for debug configuration under MSVC</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div> msvc)</div><div> cc_default="c99wrap cl"</div><div> ld_default="c99wrap link"</div>
<div>+<span style="white-space:pre-wrap"> </span>if enabled debug; then</div><div>+<span style="white-space:pre-wrap"> </span>add_ldflags -OPT:REF -DEBUG -VERBOSE</div><div>+<span style="white-space:pre-wrap"> </span>fi</div>
<div> nm_default="dumpbin -symbols"</div><div> ar_default="lib"</div><div> target_os_default="win32"</div><div> ;;</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Around line 2740:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">where it set the _cflags_speed and _cflags_size I added check for debug configuration as well, and under debug added -Oy-</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
I also appended -MD (under release) and -MDd -Zi (under debug) to the _cflags</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div> elif $_cc 2>&1 | grep -q Microsoft; then</div><div> _type=msvc</div><div> _ident=$($cc 2>&1 | head -n1)</div><div> _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'</div>
<div> _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'</div><div>+<span style="white-space:pre-wrap"> </span>if enabled debug; then</div><div>+<span style="white-space:pre-wrap"> </span>_cflags_speed="-O2 -Oy-"</div>
<div>+<span style="white-space:pre-wrap"> </span>_cflags_size="-O1 -Oy-"</div><div>+<span style="white-space:pre-wrap"> </span>else</div><div><span style="white-space:pre-wrap"> </span>_cflags_speed="-O2"</div>
<div><span style="white-space:pre-wrap"> </span>_cflags_size="-O1"</div><div>+<span style="white-space:pre-wrap"> </span>fi</div><div> # Nonstandard output options, to avoid msys path conversion issues, relies on wrapper to remap it</div>
<div> if $_cc 2>&1 | grep -q Linker; then</div><div> _ld_o='-out $@'</div><div> else</div><div> _ld_o='-Fe$@'</div><div> fi</div><div> _cc_o='-Fo $@'</div>
<div> _cc_e='-P -Fi $@'</div><div> _flags_filter=msvc_flags</div><div> _ld_lib='lib%.a'</div><div> _ld_path='-libpath:'</div><div><span style="white-space:pre-wrap"> </span>_flags='-nologo'</div>
<div> _cflags='-D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'</div><div> if [ $pfx = hostcc ]; then</div><div> append _cflags -Dsnprintf=_snprintf</div><div> fi</div>
<div>+<span style="white-space:pre-wrap"> </span>if enabled debug; then</div><div>+<span style="white-space:pre-wrap"> </span>append _cflags -MDd -Zi</div><div>+<span style="white-space:pre-wrap"> </span>else</div><div>
+<span style="white-space:pre-wrap"> </span>append _cflags -MD</div><div>+<span style="white-space:pre-wrap"> </span>fi</div><div> disable stripping</div><div> fi</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Around line 4060:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">to get rid of some warnings about unknown options I added a check for msvc there</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div>+<span style="white-space:pre-wrap"> </span>if disabled msvc; then</div><div><span style="white-space:pre-wrap"> </span>enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"</div>
<div>+<span style="white-space:pre-wrap"> </span>fi</div></div></div><div><br></div><div><br></div><div>So do these changes make sense? What can I improve? Anyone willing to try it (maybe John?)</div><div><br></div><div>best regards</div>
<div>Bjoern</div><div><br></div>