-
Notifications
You must be signed in to change notification settings - Fork 114
Building a native library #135
Comments
In theory this should work as in any non-Android platform: http://doc.crates.io/build-script.html#overriding-build-scripts |
I'm trying to build a ggez based app, which uses
What steps should I do to fix that problem? Should I create an updated docker image, which will install UPD. I installed into docker image |
That's because these packages contain a libsdl2 that targets your current platform, while you need a libsdl2 that targets Android. |
Could you please point me to the docs on how I can do it? |
If I have |
See the docs here: http://doc.crates.io/build-script.html#overriding-build-scripts Put a [target.arm-linux-androideabi.SDL2] # refers to this line: https://github.com/Rust-SDL2/rust-sdl2/blob/master/sdl2-sys/Cargo.toml#L11
rustc-link-search = ["/some/path"]
rustc-link-lib = ["SDL2"] # name of the file, with `lib` and `.so` removed |
Ok, I did a custom
|
That means that |
There are 4 libs like so
Is is possible that |
|
Well, try using only one to see if it works. |
I linked
|
Hm, probably it's not related. But it still crashes. |
Now I'm trying to build exactly one target.
then
|
ok, I finally did it. |
Got the same jni.h not found trying to compile current example:
searching for jni.h found that it is present at:
So, for me it looks like cargo apk is pointing to the wrong sysroot What am I missing ? |
Can you try things with the master version of cargo-apk? The build process has changed substantially. The current version isn't available on crates.io yet. Waiting for #221 to be resolved. The current master shouldn't have that issue. However, there is a known issue when linking to c++. The issue is discussed and has a workaround in #245. |
Thanks, building example basic and advanced works with master, looking forward to build something with a gui like conrod. If there is any project / example doing it already, could you please point me the url ? |
I am unaware of any examples that use a GUI. |
How can I use a native library I've built for Android? More specifically, I'd like to build
rust-sdl2
, however it seemscargo-apk
cannot find the built SDL2 libraries.The text was updated successfully, but these errors were encountered: