Build failure, including x265.h multiple times in a C library
Issue #39
resolved
x265_cli_csps is defined as const, which defaults to external linkage in C (unlike C++ where it defaults to internal linkage).
When including x265.h in two different C files in the same library, this causes linking to fail with errors such as:
duplicate symbol _x265_cli_csps in: /Volumes/BUFFALO_VMS/shared/hb-linux/build/libhb/libhandbrake.a(common.o) /Volumes/BUFFALO_VMS/shared/hb-linux/build/libhb/libhandbrake.a(encx265.o) ld: 1 duplicate symbol for architecture x86_64
Comments (3)
-
-
Account Deleted Yes, that's what we do to get it to build:
https://trac.handbrake.fr/browser/trunk/contrib/x265/A01-x265-multiple-inclusion.patch
-
- changed status to resolved
api: declare x265_cli_csps as static const (closes
#39)Fixes link errors when x265.h is included by multiple C files.
→ <<cset dc700298419d>>
- Log in to comment
Does declaring it 'static const' resolve the problem?