[x265] Problem with linking x265 and ffmpeg

Derek Buitenhuis derek.buitenhuis at gmail.com
Tue Apr 22 18:00:00 CEST 2014


On 4/22/2014 4:49 PM, 宮村 公男 wrote:
> $ ./configure --prefix=${TARGET} --as=yasm --enable-gpl --enable-libx265 --pkg-config-flags=—static
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
> Package —static was not found in the pkg-config search path.
> Perhaps you should add the directory containing `—static.pc'
> to the PKG_CONFIG_PATH environment variable
> No package '—static' found
> Package —static was not found in the pkg-config search path.
> Perhaps you should add the directory containing `—static.pc'
> to the PKG_CONFIG_PATH environment variable
> No package '—static' found
> ERROR: x265 not found

Uhhhhhhhhhhhhh wtf?

Why the heck are you passing a '—', (em-dash) instead of two '-' (en-dash). That
is seriously wrong. This is user error on your end.

> Have you read his comment carefully?
> 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.

Incorrect on two levels for you.

1. Your compiler is using libc++, not libstdc++. This is the C++ runtime that
   it uses. Using libstdc++ is *incorrect*.
2. pkg-config should only report -lc++ or -lstdc++ with --cflags when --static
   is given. This is correct behavior. The runtime only needs to be given explicitly
   when statically linking, and if you are statically linking, pkg-config needs the
   --static argument. End of story.

- Derek


More information about the x265-devel mailing list