undefined symbol BrotliEncoderDestroyPreparedDictionary #488

Closed
opened 2026-01-29 20:44:45 +00:00 by claunia · 5 comments
Owner

Originally created by @0x-2a on GitHub (Nov 1, 2023).

After fresh pull and cmake of 1.1.0 am seeing a symbol lookup error for BrotliEncoderDestroyPreparedDictionary. Are there additional build args needed?

OS: Amazon Linux 2023
Arch: x86

wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz
tar -xvzf v1.1.0.tar.gz
cd brotli-1.1.0/

mkdir out && cd out
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed ..
cmake --build . --config Release --target install

./install-files/bin/brotli --version
brotli 1.1.0
./install-files/bin/brotli: symbol lookup error: ./install-files/bin/brotli: undefined symbol: BrotliEncoderDestroyPreparedDictionary
Originally created by @0x-2a on GitHub (Nov 1, 2023). After fresh pull and cmake of `1.1.0` am seeing a symbol lookup error for `BrotliEncoderDestroyPreparedDictionary`. Are there additional build args needed? OS: Amazon Linux 2023 Arch: x86 ```sh wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz tar -xvzf v1.1.0.tar.gz cd brotli-1.1.0/ mkdir out && cd out cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed .. cmake --build . --config Release --target install ./install-files/bin/brotli --version brotli 1.1.0 ./install-files/bin/brotli: symbol lookup error: ./install-files/bin/brotli: undefined symbol: BrotliEncoderDestroyPreparedDictionary ```
Author
Owner

@eustas commented on GitHub (Nov 3, 2023):

Will check soon. Thanks for the heads-up.

@eustas commented on GitHub (Nov 3, 2023): Will check soon. Thanks for the heads-up.
Author
Owner

@eustas commented on GitHub (Nov 3, 2023):

The problem is that unless you really install brotli, you have to specify LD_LIBRARY_PATH to point to ./installed/lib. Otherwise linked searches and finds system library does not contain mentioned symbol.

@eustas commented on GitHub (Nov 3, 2023): The problem is that unless you really install `brotli`, you have to specify `LD_LIBRARY_PATH` to point to `./installed/lib`. Otherwise linked searches and finds system library does not contain mentioned symbol.
Author
Owner

@0x-2a commented on GitHub (Nov 3, 2023):

Oh right, thanks!

@0x-2a commented on GitHub (Nov 3, 2023): Oh right, thanks!
Author
Owner

@C-Collamar commented on GitHub (Feb 15, 2024):

The problem is that unless you really install brotli, you have to specify LD_LIBRARY_PATH to point to ./installed/lib. Otherwise linked searches and finds system library does not contain mentioned symbol.

@eustas How can I "really install brotli"? Sorry, I'm new to this.

@C-Collamar commented on GitHub (Feb 15, 2024): > The problem is that unless you really install `brotli`, you have to specify `LD_LIBRARY_PATH` to point to `./installed/lib`. Otherwise linked searches and finds system library does not contain mentioned symbol. @eustas How can I "really install `brotli`"? Sorry, I'm new to this.
Author
Owner

@C-Collamar commented on GitHub (Feb 15, 2024):

I get it now. To fix this undefined symbol error by "really" installing brotli, I have to set -DCMAKE_INSTALL_PREFIX to a path where the system usually looks into.

- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed ..
+ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. 

So when I run Brotli as follows, the error goes away.

LD_LIBRARY_PATH=/usr/local/lib64 brotli --version

Now I only need to figure out how to run Brotli without specifying LD_LIBRARY_PATH every time.

Thanks anyway!


Update:

For others like me who just want to run Brotli without specifying LD_LIBRARY_PATH every time, here's the solution I ended up with.

BROTLI_VERSION="v1.1.0"
INSTALL_PREFIX="/usr/local"
INSTALL_LIBDIR="$INSTALL_PREFIX/lib64/brotli"

# build and install
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_INSTALL_LIBDIR=$INSTALL_LIBDIR -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release --target install

# link the libraries that brotli needs at runtime
echo "$INSTALL_LIBDIR" > "/etc/ld.so.conf.d/brotli-$BROTLI_VERSION.conf"
chmod 644 "/etc/ld.so.conf.d/brotli-$BROTLI_VERSION.conf"
ldconfig

Hope this helps.

@C-Collamar commented on GitHub (Feb 15, 2024): I get it now. To fix this undefined symbol error by "really" installing `brotli`, I have to set `-DCMAKE_INSTALL_PREFIX` to a path where the system usually looks into. ```diff - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed .. + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. ``` So when I run Brotli as follows, the error goes away. ```bash LD_LIBRARY_PATH=/usr/local/lib64 brotli --version ``` Now I only need to figure out how to run Brotli without specifying `LD_LIBRARY_PATH` every time. Thanks anyway! --- Update: For others like me who just want to run Brotli without specifying `LD_LIBRARY_PATH` every time, here's the solution I ended up with. ```bash BROTLI_VERSION="v1.1.0" INSTALL_PREFIX="/usr/local" INSTALL_LIBDIR="$INSTALL_PREFIX/lib64/brotli" # build and install cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_INSTALL_LIBDIR=$INSTALL_LIBDIR -DCMAKE_BUILD_TYPE=Release .. cmake --build . --config Release --target install # link the libraries that brotli needs at runtime echo "$INSTALL_LIBDIR" > "/etc/ld.so.conf.d/brotli-$BROTLI_VERSION.conf" chmod 644 "/etc/ld.so.conf.d/brotli-$BROTLI_VERSION.conf" ldconfig ``` Hope this helps.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#488