-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
This project builds against a fairly old version of libjpeg (9d released in 2020). I am trying to compile a project that links against both FreeImage and OpenCV in a Bazel build system (FreeImage Bazel BUILD file on Bazel Central Registry), but linking fails due to ODR violation:
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld.lld: error: duplicate symbol: jpeg_abort
>>> defined at jcomapi.c
>>> bazel-out/haswell-opt/bin/external/libjpeg_turbo+/_objs/jpeg/jcomapi.o:(jpeg_abort)
>>> defined at jcomapi.c
>>> bazel-out/haswell-opt/bin/external/freeimage+/_objs/libjpeg/jcomapi.o:(.text.jpeg_abort+0x0)
The error occurs because FreeImage exports jpeg symbols from its vendored copy of libjpeg, which conflict with identical symbols from libjpeg_turbo exported through opencv.
It would be ideal if FreeImage could be updated to use a newer version of libjpeg such as libjpeg_turbo 3.1.3.
Metadata
Metadata
Assignees
Labels
No labels