Open
Description
Describe the bug
Cannot build a shared library using the the C++ SDK by following the default instructions
since the static library is built without position independent code.
To Reproduce
Steps to reproduce the behavior:
- Follow these C++ SDK instructions and add it to a shared library project
- Attempt to compile
- Results in an error since the static library was not compiled with the
-fPIC
flag on
Fix
I managed to get things working by compiling from source with the following flags:
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-fpic"
I think it's a good idea to either add the flag by default (not sure what the repercussions are) or mention it in the documentation. Happy to look into either and submit a PR.