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

Undefined reference to egl and gl issue #233

Open
Nirklav opened this issue Aug 19, 2019 · 4 comments
Open

Undefined reference to egl and gl issue #233

Nirklav opened this issue Aug 19, 2019 · 4 comments

Comments

@Nirklav
Copy link
Contributor

Nirklav commented Aug 19, 2019

When I migrated my project to cargo-apk from the current dev branch, I ran into this problem.

Test project:
cargo-apk-repro-case.zip

Output:

Compiling injected-glue for armv7-linux-androideabi
   Compiling cargo_apk_test v0.1.0 (D:\Sources\cargo_apk_test)
    Finished dev [unoptimized + debuginfo] target(s) in 1.45s
[armeabi-v7a] Compile thumb  : android_native_app_glue <= android_native_app_glue.c
[armeabi-v7a] StaticLibrary  : libandroid_native_app_glue.a
[armeabi-v7a] SharedLibrary  : libcargo_apk_test.so
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:466: error: undefined reference to 'eglGetDisplay'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:508: error: undefined reference to 'eglInitialize'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:515: error: undefined reference to 'eglMakeCurrent'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:536: error: undefined reference to 'eglQueryString'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:305: error: undefined reference to 'eglChooseConfig'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:326: error: undefined reference to 'eglCreateContext'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:403: error: undefined reference to 'eglDestroyContext'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:417: error: undefined reference to 'eglDestroySurface'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:494: error: undefined reference to 'eglGetProcAddress'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:431: error: undefined reference to 'eglGetConfigAttrib'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:445: error: undefined reference to 'eglGetCurrentContext'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:452: error: undefined reference to 'eglGetCurrentDisplay'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:459: error: undefined reference to 'eglGetCurrentSurface'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:396: error: undefined reference to 'eglCreateWindowSurface'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:347: error: undefined reference to 'eglCreatePbufferSurface'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:291: error: undefined reference to 'eglBindAPI'
D:\Sources\cargo_apk_test\target\armv7-linux-androideabi\debug\build\glutin_egl_sys-15abc7f6cc9d7d52\out/egl_bindings.rs:473: error: undefined reference to 'eglGetError'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi-v7a/libcargo_apk_test.so] Error 1
error: process didn't exit successfully: `cmd /C D:\Android_NDK\android-ndk-r15b\build/ndk-build.cmd NDK_LIBS_OUT=./lib` (exit code: 2)
@philip-alldredge
Copy link
Contributor

philip-alldredge commented Aug 19, 2019

This is likely the same as #230 and is caused by a regression in the build system. The fix is waiting to be merged #232. Do you mind trying it with the branch that is waiting to be merged?

https://github.com/philip-alldredge/android-rs-glue/tree/230-no-ndk-build

@philip-alldredge
Copy link
Contributor

@Nirklav @mb64 FYI. I was able to build using #232.

@Nirklav
Copy link
Contributor Author

Nirklav commented Aug 20, 2019

@philip-alldredge, i was able to build my project too, with this branch, thanks!

@philip-alldredge
Copy link
Contributor

Great. Thanks for letting me know.

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

2 participants