Skip to content
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

Can i build static library with 'go build' for android platform? #39608

Closed
flame2017 opened this issue Jun 16, 2020 · 4 comments
Closed

Can i build static library with 'go build' for android platform? #39608

flame2017 opened this issue Jun 16, 2020 · 4 comments

Comments

@flame2017
Copy link

When i tried to build a static library with 'go build' tools, i got this error:

@flame2017
Copy link
Author

command-line-arguments

invalid value "c-archive" for flag -buildmode: buildmode c-archive not supported on android/arm
.....

it`s a cross-compile Project, my environment is :
export GOOS=android
export GOARCH=arm
export GOARM=7
export CGO_ENABLED=1
export CC=/app/go-hoofoo/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi28-clang
export CXX=/app/go-hoofoo/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi28-clang++

@flame2017
Copy link
Author

the compile command was: go build -buildmode=c-archive -o libfoo.a *.go

@flame2017
Copy link
Author

Can any body help me ?

@mdlayher
Copy link
Member

@golang golang locked and limited conversation to collaborators Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants