New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/mobile: gomobile fails with linker error #24058
Labels
Milestone
Comments
It seems the library doesn't build:
|
I probably should create simple cpp project to test 'undefined reference', 'dev' branch compiles. Since goland does not support version control for imported code those are common complications build success or failed... I guess you can just run:
|
Change https://golang.org/cl/99875 mentions this issue: |
imWildCat
pushed a commit
to imWildCat/go-mobile
that referenced
this issue
Apr 10, 2021
Issue golang/go#24058 demonstrates a Go package that fails to build with gomobile but builds successfully with a manually using the standalone NDK toolchain. I haven't been able to figure out a set of CPPFLAGS/LDFLAGS that fixes the build for 24058 so instead rework gomobile to use standalone NDK toolchains. Standalone toolchains fixes the 24058 build and is the official way to build Android programs. So gomobile should be less affected by future changes in the NDK toolchain internals. Create the standalone toolchains with gomobile init. With the new Go 1.10 build cache, the prebuild work by the gomobile init command is useless. Use the opportunity to simplify init to only creating NDK toolchains and, optionally, building OpenAL for Android. With that, it is no longer necessary to use gomobile init to build iOS apps and frameworks. Fixes golang/go#24058 Change-Id: I4692fcaa927e7076a6387d080ebc1726905afd72 Reviewed-on: https://go-review.googlesource.com/99875 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
imWildCat
pushed a commit
to imWildCat/go-mobile
that referenced
this issue
Apr 11, 2021
Issue golang/go#24058 demonstrates a Go package that fails to build with gomobile but builds successfully with a manually using the standalone NDK toolchain. I haven't been able to figure out a set of CPPFLAGS/LDFLAGS that fixes the build for 24058 so instead rework gomobile to use standalone NDK toolchains. Standalone toolchains fixes the 24058 build and is the official way to build Android programs. So gomobile should be less affected by future changes in the NDK toolchain internals. Create the standalone toolchains with gomobile init. With the new Go 1.10 build cache, the prebuild work by the gomobile init command is useless. Use the opportunity to simplify init to only creating NDK toolchains and, optionally, building OpenAL for Android. With that, it is no longer necessary to use gomobile init to build iOS apps and frameworks. Fixes golang/go#24058 Change-Id: I4692fcaa927e7076a6387d080ebc1726905afd72 Reviewed-on: https://go-review.googlesource.com/99875 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
What did you do?
trying to compile https://gitlab.com/axet/libtorrent with following error
My first guess this is gomobile issues. According to https://stackoverflow.com/questions/6045809 here something wrong with -lstdcpp definition.
Adding
#cgo LDFLAGS: -lstdc++
to the https://github.com/anacrolix/go-libutp/blob/master/utp.go does not solve the issue.The text was updated successfully, but these errors were encountered: