[x264-devel] extern cli_input required when compiling shared library.

Henrik Gramner henrik at gramner.com
Sun Nov 6 15:49:26 CET 2016


On Sun, Nov 6, 2016 at 3:10 PM, Wim Rijnders <wrijnders at gmail.com> wrote:
>   OSError: /home/wim/projects/cogisen/qt_workspaces/libs/libx264.so.148:
> undefined symbol: cli_input
>
> On tracing the issues, I see that the following is defined in input/input.h:
>
>    extern cli_input_t cli_input;
>
> The only place this variable is defined, is in main() of x264.c, which
> rightly is outside of
> the shared library.
>
> The question is: Can this extern declaration be removed from the shared
> library build?

The entire input/ directory is CLI only, and that header is not
included from any library code as far as I can see so I'm quite
puzzled as to why you're getting that error. Could you test again with
a completely fresh copy of git master?

> .../common/rectangle.h: In function ‘void x264_macroblock_cache_rect(void*,
> int, int, int, uint32_t)’:
> .../common/rectangle.h:30:18: error: invalid conversion from ‘void*’ to
> ‘uint8_t* {aka unsigned char*}’ [-fpermissive]
>      uint8_t *d = dst;
>                   ^
> src/./subdir.mk:23: recipe for target 'src/./main.o' failed
>
> I requet you to change the following:
>
> common/rectangle.h, line 30,
> from:
>     uint8_t *d = dst;
> to:
>     uint8_t *d = (uint8_t *) dst;
>
> I understand that this is due to the very strict checks I enabled on my
> project. However, I'd rather see this line changed (for the benefit of all)
> than lower the checking level to compensate for this.

Implicitly casting void* to other data types is the normal way of
doing it in C. It's done in tons and tons of places throughout the
code base, such as every malloc call for example. Why the compiler
decides to make that line in particular trigger a warning/error is a
more interesting question.


More information about the x264-devel mailing list