Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6931 closed defect (invalid)

FreeBSD compilation error

Reported by: vinchi007 Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
Problem compiling ffmpeg in FreeNAS jail compiler (freebsd 10.3), error x265 not found using pkg-config

following shows no errors, .pc, lib, .h files properly located in respective paths in /usr/local:

 pkg-config --exists --print-errors x265
[root@compiler /usr/local/build/ffmpeg]# ./configure --cc=/usr/local/bin/gcc5 --pkg-config-flags="--static" --disable-shared --enable-nonfree --enable-gpl --enable-hardcoded-tables --enable-version3 --enable-libx264 --enable-libx265 --enable-avfilter --enable-filters --enable-libfdk-aac --disable-indevs --disable-outdevs --disable-ffserver --disable-network
ERROR: x265 not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the mailing list or IRC #ffmpeg on
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

Here is config.log:

require_pkg_config libx265 x265 x265.h x265_api_get
check_pkg_config libx265 x265 x265.h x265_api_get
test_pkg_config libx265 x265 x265.h x265_api_get
pkg-config --exists --print-errors x265
check_func_headers x265.h x265_api_get -I/usr/local/include -L/usr/local/lib -lx265 -lstdc++ -lm -lgcc_s -lgcc -lgcc_s -lgcc -lrt
check_ld cc -I/usr/local/include -L/usr/local/lib -lx265 -lstdc++ -lm -lgcc_s -lgcc -lgcc_s -lgcc -lrt
check_cc -I/usr/local/include -L/usr/local/lib
BEGIN /tmp/ffconf.3QtYkGTN/test.c
    1   #include <x265.h>
    2   #include <stdint.h>
    3   long check_x265_api_get(void) { return (long) x265_api_get; }
    4   int main(void) { int ret = 0;
    5    ret |= ((intptr_t)check_x265_api_get) & 0xFFFF;
    6   return ret; }
END /tmp/ffconf.3QtYkGTN/test.c
/usr/local/bin/gcc5 -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -std=c11 -fomit-frame-pointer -pthread -I/usr/local/include -I/usr/local/include -I/usr/local/include -L/usr/local/lib -c -o /tmp/ffconf.3Qt
YkGTN/test.o /tmp/ffconf.3QtYkGTN/test.c
/usr/local/bin/gcc5 -Wl,--as-needed -Wl,-z,noexecstack -I/usr/local/include -L/usr/local/lib -o /tmp/ffconf.3QtYkGTN/test /tmp/ffconf.3QtYkGTN/test.o -lx265 -lstdc++ -lm -lgcc_s -lgcc -lgcc_s -lgcc -lrt
/tmp/ffconf.3QtYkGTN/test.o: In function `check_x265_api_get':
test.c:(.text+0x1): undefined reference to `x265_api_get_146'
collect2: error: ld returned 1 exit status
ERROR: x265 not found using pkg-config

Change History (4)

in reply to:  description comment:1 by Carl Eugen Hoyos, 6 years ago

Component: ffmpegundetermined
Resolution: invalid
Status: newclosed
Version: 3.4unspecified

Replying to vinchi007:

/tmp/ffconf.3QtYkGTN/test.o: In function `check_x265_api_get':
test.c:(.text+0x1): undefined reference to `x265_api_get_146'

This usually indicates that the header version (146) does not match the library version.

comment:2 by vinchi007, 6 years ago

can you please provide more details?

comment:3 by Carl Eugen Hoyos, 6 years ago

Not really but my suspicion is that you have one x265 library in /usr/lib and another one in /usr/local/lib. A possible solution would be to remove the .so symlink from /usr/lib (or the x265-dev/x265-devel package). Another explanation is that the header and the library in /usr/local do not match, the following can show the library version (assuming a shared library, try libx265.a instead of if you installed a static library):

$ nm /usr/local/lib/|grep x265_api_get

A third possible explanation is that you first installed a shared library into /usr/local and later a newer version as a static library.
Please understand that this is a bug tracker, all usage questions should be discussed on the user mailing list.

in reply to:  2 comment:4 by James, 6 years ago

Replying to vinchi007:

can you please provide more details?

The x265 header expects the function x265_api_get_146 to exist in but it isn't.
This means the x265.h and x265_config.h headers you have in your environment (for API 146) do not match the libx265.a and/or libraries (For some other API version).

Try recompiling/reinstalling libx265 to get matching headers and library.

Note: See TracTickets for help on using tickets.