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

@flame2017 flame2017 commented Jun 16, 2020

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

@flame2017
Copy link
Author

@flame2017 flame2017 commented Jun 16, 2020

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

@flame2017 flame2017 commented Jun 16, 2020

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

@flame2017
Copy link
Author

@flame2017 flame2017 commented Jun 16, 2020

Can any body help me ?

@mdlayher
Copy link
Member

@mdlayher mdlayher commented Jun 16, 2020

@mdlayher mdlayher closed this Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.