<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>2014/04/22 2:07、Derek Buitenhuis <derek.buitenhuis <at> <a href="http://gmail.com">gmail.com</a>> のメール:</div><br class="Apple-interchange-newline"><blockquote type="cite">On 4/21/2014 5:37 AM, 宮村 公男 wrote:<br><blockquote type="cite">Here’s his comment:<br>“In order to be able to link libx265 to ffmpeg it requires -lstdc++ as a compiler flag yet it does not provide it via pkg-config when ffmpeg asks for the -cflags of libx265. It should add -lstdc++ to its Libs: line of the x265.pc file.”<br></blockquote><br>-lc++ *IS ADDED* if pkg-config is invoked with --static <br>during configure, which is what this configure option does.<br><br>Did you actually even try it? I get the feeling you didn’t.<br></blockquote><div><br></div><span style="font-family: Menlo-Regular; font-size: 13px;">I do tried to configure ffmpeg by adding "--pkg-config-flags=—static”</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Here’s command line output and config.log of ffmpeg with your replay.  </span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;"><command line output></span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ ./configure --prefix=${TARGET} --as=yasm --enable-gpl --enable-libx265 --pkg-config-flags=—static</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Package —static was not found in the pkg-config search path.</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Perhaps you should add the directory containing `—static.pc'</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">to the PKG_CONFIG_PATH environment variable</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">No package '—static' found</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Package —static was not found in the pkg-config search path.</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Perhaps you should add the directory containing `—static.pc'</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">to the PKG_CONFIG_PATH environment variable</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">No package '—static' found</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">ERROR: x265 not found</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;"><config.log></span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">check_pkg_config x265 x265.h x265_encoder_encode</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">pkg-config --exists --print-errors x265</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">check_func_headers x265.h x265_encoder_encode</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">check_ld cc</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">check_cc</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">BEGIN /var/folders/qk/x9k9r6f955d75dnv5dd2rgm00000gn/T//ffconf.IUpdYOQo.c</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">   1</span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 13px; white-space: pre;">       </span><span style="font-family: Menlo-Regular; font-size: 13px;">#include <x265.h></span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">   2</span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 13px; white-space: pre;">  </span><span style="font-family: Menlo-Regular; font-size: 13px;">long check_x265_encoder_encode(void) { return (long) x265_encoder_encode; }</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">   3</span><span class="Apple-tab-span" style="font-family: Menlo-Regular; font-size: 13px; white-space: pre;">      </span><span style="font-family: Menlo-Regular; font-size: 13px;">int main(void) { return 0; }</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">END /var/folders/qk/x9k9r6f955d75dnv5dd2rgm00000gn/T//ffconf.IUpdYOQo.c</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -I/Volumes/ffmpeg_compile/include -L/Volumes/ffmpeg_compile/lib -std=c99 -mdynamic-no-pic -fomit-frame-pointer -fPIC -pthread -c -o /var/folders/qk/x9k9r6f955d75dnv5dd2rgm00000gn/T//ffconf.mIIfdUZ5.o /var/folders/qk/x9k9r6f955d75dnv5dd2rgm00000gn/T//ffconf.IUpdYOQo.c</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">clang: warning: argument unused during compilation: '-L/Volumes/ffmpeg_compile/lib'</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">gcc -L/Volumes/ffmpeg_compile/lib -Wl,-dynamic,-search_paths_first -o /var/folders/qk/x9k9r6f955d75dnv5dd2rgm00000gn/T//ffconf.FoLI6JH8 /var/folders/qk/x9k9r6f955d75dnv5dd2rgm00000gn/T//ffconf.mIIfdUZ5.o -lm -lbz2 -lz -pthread</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">clang: warning: argument unused during compilation: '-pthread'</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Undefined symbols for architecture x86_64:</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;"> "_x265_encoder_encode", referenced from:</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">     _check_x265_encoder_encode in ffconf.mIIfdUZ5.o</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">    (maybe you meant: _check_x265_encoder_encode)</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">ld: symbol(s) not found for architecture x86_64</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">clang: error: linker command failed with exit code 1 (use -v to see invocation)</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">ERROR: x265 not found</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Have you read his comment carefully?</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">He say "-lstdc++” compiler flag should be passed to ffmpeg via pkg-config (x265.pc) when ffmpeg asks for the -cflags of x265.  But current x265 does not provide it.</span></div><div><font face="Menlo-Regular" size="2"><br></font></div><div><font face="Menlo-Regular" size="2"><br></font><blockquote type="cite"><blockquote type="cite">So x265.pc should be as follows:<br>--- a/x265.pc<span class="Apple-tab-span" style="white-space:pre">   </span>2014-04-16 14:50:20.000000000 +0900<br>+++ b/x265.pc<span class="Apple-tab-span" style="white-space:pre">  </span>2014-04-21 10:54:32.000000000 +0900<br>@@ -6,6 +6,6 @@<br>Name: x265<br>Description: H.265/HEVC video encoder<br>Version: 0.9<br>-Libs: -L${libdir} -lx265<br>+Libs: -L${libdir} -lx265 -lstdc++<br>Libs.private: -lc++ -l/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/5.1/lib/darwin/libclang_rt.osx.a<br>Cflags: -I${includedir}<br></blockquote><br>Incorrect. You are adding the wrong C++ stdlib. See my <br>explanation above.</blockquote><br></div><div><span style="font-family: Menlo-Regular; font-size: 13px;">I can’t understand what is incorrect.  by addiing "-lstdc++” compiler flag to Libs: line of x265.pc, We can solve this “x265 not found” problem.  </span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">This must be a bug with x265.</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Also, I have problem with x265 shard build:</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ export VOLNAME=x265-ffmpeg</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ export TARGET="/Volumes/${VOLNAME}"</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ export PATH=${TARGET}/bin:$PATH</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ cd ../x265/build/</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ mkdir shard</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ cd shard/</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ cmake -DCMAKE_INSTALL_PREFIX:PATH=${TARGET} ../../source/</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ make -j 4 && make install</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Install configuration: "Release"</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Installing: /Volumes/x265-ffmpeg/lib/libx265.a</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Up-to-date: /Volumes/x265-ffmpeg/include/x265.h</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Installing: /Volumes/x265-ffmpeg/include/x265_config.h</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Installing: /Volumes/x265-ffmpeg/lib/libx265.0.0.dylib</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Installing: /Volumes/x265-ffmpeg/lib/libx265.16.dylib</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Installing: /Volumes/x265-ffmpeg/lib/libx265.dylib</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Installing: /Volumes/x265-ffmpeg/lib/pkgconfig/x265.pc</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">-- Installing: /Volumes/x265-ffmpeg/bin/x265</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ which x265</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">/Volumes/x265-ffmpeg/bin/x265</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ cd ~</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">$ x265 --help</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">dyld: Library not loaded: libx265.16.dylib</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;"> Referenced from: /Volumes/x265-ffmpeg/bin/x265</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;"> Reason: image not found</span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Trace/BPT trap: 5</span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">Same as x265 binary, ffmpeg binary fails to execute because x265 shard library can’t be loaded.  </span><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">I’d like to know what is happening with x265 shard library too.  </span><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><br style="font-family: Menlo-Regular; font-size: 13px;"><span style="font-family: Menlo-Regular; font-size: 13px;">// Miya</span></div></body></html>