YET AGAIN you have broken C compilation by including bool in x265.h

Issue #472 new
Former user created an issue

Commit 2abd2a1 uses the bool type in the header used by C language projects.

bool is not a type in C.

You must include <stdbool.h> for it to work.

This breaks all C projects using x265, including ffmpeg - they will fail at the configure/pkgconfig stage as the x265.h header fails to compile.

Please introduce automated testing - at least make sure the project and a simple C test program that includes x265.h compile cleanly before committing code in future!

Comments (5)

  1. Pradeep Ramachandran Account Deactivated

    Thanks for the report! I wonder why our automated tests didn't catch this. We will fix this asap.

  2. Jim Worrall

    It sounds like this might be what’s preventing me from configuring ffmpeg; complaining that pkg-config can’t find x265 although it is in the pkg-config path. I gather the changeset linked above has not yet been incorporated. Can you recommend a work-around until this is fixed, or do I need to edit all those files? I can’t figure it out.

    EDIT: oops, looks like this has been addressed; I must be having a different issue. Or the changeset didn’t fix it. Here is the end of my ffmpeg config.log:

    /usr/bin/clang -I/usr/local/ffmpeg/target/include -I/usr/local/include -L/usr/local/ffmpeg/target/lib -L/usr/local/lib -lstdc++ -L/usr/local/ffmpeg/target/lib -Wl,--as-needed -Wl,-z,noexecstack -I/usr/local/ffmpeg/target/include -o /tmp/ffconf.EtOtzVZH/test /tmp/ffconf.EtOtzVZH/test.o -lx265 -lc++ -lm -lgcc -lgcc_s -lgcc -lgcc_s -lrt -ldl
    /usr/local/ffmpeg/target/lib/libx265.a(api.cpp.o): In function x265_api_get_176': api.cpp:(.text+0x2cfd): undefined reference tox265_10bit::x265_api_get_176(int)'
    api.cpp:(.text+0x2db6): undefined reference to x265_12bit::x265_api_get_176(int)' /usr/local/ffmpeg/target/lib/libx265.a(api.cpp.o): In functionx265_api_query':
    api.cpp:(.text+0x2e4d): undefined reference to x265_10bit::x265_api_query(int, int, int*)' api.cpp:(.text+0x2e74): undefined reference tox265_12bit::x265_api_query(int, int, int*)'
    /usr/local/ffmpeg/target/lib/libx265.a(threading.cpp.o): In function x265::Thread::start()': threading.cpp:(.text+0x24): undefined reference topthread_create'
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ERROR: x265 not found using pkg-config

    It looks like pkg-config did find libx265.a, but something goes wrong in there?

    Oh, the version I have:

    [root@ffmpeg /usr/local/ffmpeg/build/x265]# x265 --version
    x265 [info]: HEVC encoder version 3.1+2-b36c03e4e771
    x265 [info]: build info [Unk-OS][clang 6.0.0][64 bit] 8bit+10bit+12bit
    x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2

  3. Log in to comment