Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build fails on HTTP feauture disabled #49

Open
devingryu opened this issue Apr 8, 2024 · 0 comments
Open

CMake build fails on HTTP feauture disabled #49

devingryu opened this issue Apr 8, 2024 · 0 comments

Comments

@devingryu
Copy link

It seems that build fails on these options are set.

OP_DISABLE_HTTP=ON
OP_DISABLE_DOCS=ON

The following are error logs.

[1/2] Linking C executable opusfile_example
FAILED: opusfile_example 
: && /home/user/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android24 --sysroot=/home/user/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -O2 -g -DNDEBUG -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--no-undefined-version -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments   -Wl,--gc-sections CMakeFiles/opusfile_example.dir/examples/opusfile_example.c.o -o opusfile_example  libopusfile.so  -lopusurl  /shared/aarch64/lib/libogg.so  /shared/aarch64/lib/libopus.so  -lm  -latomic -lm && :
ld.lld: error: unable to find library -lopusurl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[2/2] Linking C executable seeking_example
FAILED: seeking_example 
: && /home/user/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android24 --sysroot=/home/user/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -O2 -g -DNDEBUG -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--no-undefined-version -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments   -Wl,--gc-sections CMakeFiles/seeking_example.dir/examples/seeking_example.c.o -o seeking_example  libopusfile.so  -lopusurl  /shared/aarch64/lib/libogg.so  /shared/aarch64/lib/libopus.so  -lm  -latomic -lm && :
ld.lld: error: unable to find library -lopusurl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

The problem is clear: CMakeFiles.txt is set to link the opusurl when it builds the example. So setting OP_DISABLE_EXAMPLES=ON solves the issue.

I propose two solutions for this:

  1. Splitting the example code into two, one that uses the network and one that doesn't.
  2. Disable building examples on OP_DISABLE_HTTP=ON is set.

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant