Android/arm64 build problem

my go env follow:

in my .bashrc follow:

my main.go follow:

but my build has error follow:

sorry, my english is poor.
have any idea!?

Is mark allowed to read in and below of /root?

That’s a strange place to put anything…

I move sdk to /home/username/Android/Sdk.
but I get same error.
I go to ndk/platforms/android-28 and find include dectory, but can’t find .

Have you checked ownership and permissions?

yes, all chmod 777

As you are using go directly, you might also need to throw in some -I… to the CGO_* vars.

But does go even use the correct gcc then?

I never did go for android…

ok, I will try.

sorry, I am give up.
thanks your idea.
I build success, but *.so include by qt.
App always crash.
use qlibrary get same result.
I am fuvk give up.

What was your goal?

Why havent you used gomobile?

In your screenshot, GOTOOLDIR looks suspect to me…

My goal follow:
golang build to and use qt(c++) call golang’s lib.
because qt http lib is bad, so I want to use golang http lib.
I has been try ↓
I download arm64 gcc, and build golang.(GOOS=android or linux; GOARCH=arm64)
I download arm gcc and build golang. (GOOS=android or linux, GOARCH=arm)
all build success. (go build -buildmode=c_shared -o main.go)
but app crash.

why not use gomobile!?
because gomobild make .arr.
I have to use c++ call jni, I am feeling a detour.

I don’t know GOTOOLDIR make you suspect.
is there any error!?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.