Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Common problems with linking with static c++ libs #259

Open
katyo opened this issue Jan 1, 2020 · 1 comment
Open

Common problems with linking with static c++ libs #259

katyo opened this issue Jan 1, 2020 · 1 comment

Comments

@katyo
Copy link
Contributor

katyo commented Jan 1, 2020

I developed bindings to c++ library, which widely uses global variables, which requires runtime initialization/finalization.
The library builds using clang++ from android NDK.

I have many linking errors like an error: undefined reference to '__dso_handle' when I build application.

I'm sure that this is common problem, but I still cannot find appropriate workaround, which can help solve this.

I guess that linker itself should use appropriate crt*.o module to deal around it but I don't know details why this is not so.

@katyo
Copy link
Contributor Author

katyo commented Jan 1, 2020

Currently I know only one way to avoid this issue: dynamic linking between C++ object and rust app. But in this case I cannot simply publish it on a crates.io

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

No branches or pull requests

1 participant