Bazel shared library does not include all symbols

  android, bazel, c++, cross-compiling, mediapipe

I am trying to build a shared library using bazel (mediapipe) and linking dependencies without sources or headers fails to include the dependency symbols.

Here is sorta psudo code example

    name = "",
    deps = ["//project:dependency"],
    linkshared = 1,

Some other file:

   name = "dependency",
   srcs = [""],
   hdrs = ["file.h"]

in file.h

class MyClass {
   int abc = 0;

Then when I build with Android let’s say

bazel build -c opt --config=android_arm --linkopt="-s"

After I build, the shared library does not contain any symbols from file.h (MyClass) using

nm -D output/ | grep MyClass

Is there a way to do it? I am also new to bazel.

A more defined question is located on mediapipe’s issues page.

Source: Windows Questions C++