Skip to content

Documented instructions do not work when using the C++ SDK in a shared library #8660

Open
@svepe

Description

@svepe

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:

  1. Follow these C++ SDK instructions and add it to a shared library project
  2. Attempt to compile
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed🌊 C++ APIC/C++ API specific📖 documentationImprovements or additions to documentation🪳 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions