golang-ui / nuklear

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.

Home Page:https://github.com/vurtun/nuklear

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nk-example build fails on Ubuntu

wilyarti opened this issue · comments

I have installed the NDK and have my variables set. The make command fails with the following:

simulator@ubuntu:~/go/src/github.com/golang-ui/nuklear/cmd/nk-android$ make
mkdir -p android/jni/lib
CC="/home/simulator/go/src/github.com/golang-ui/nuklear/cmd/nk-android/toolchain/bin/arm-linux-androideabi-gcc" \
CXX="/home/simulator/go/src/github.com/golang-ui/nuklear/cmd/nk-android/toolchain/bin/arm-linux-androideabi-g++" \
CGO_CFLAGS="-march=armv7-a -std=c99" \
GOOS=android \
GOARCH=arm \
GOARM=7 \
CGO_ENABLED=1 \
go build -tags gles3 -buildmode=c-shared -o android/jni/lib/libnkactivity.so
# runtime/cgo
/tmp/go-build851112965/runtime/cgo/_obj/gcc_android.o:gcc_android.c:function fatalf: error: undefined reference to 'stderr'
/tmp/go-build851112965/runtime/cgo/_obj/gcc_libinit.o:gcc_libinit.c:function x_cgo_sys_thread_create: error: undefined reference to 'stderr'
/tmp/go-build851112965/runtime/cgo/_obj/gcc_util.o:gcc_util.c:function x_cgo_thread_start: error: undefined reference to 'stderr'
collect2: error: ld returned 1 exit status
Makefile:14: recipe for target 'build' failed
make: *** [build] Error 2
simulator@ubuntu:~/go/src/github.com/golang-ui/nuklear/cmd/nk-android$ printenv | grep NDK
NDK=/home/simulator/Android/Sdk/ndk-bundle
simulator@ubuntu:~/go/src/github.com/golang-ui/nuklear/cmd/nk-android$ printenv | grep ANDROID
ANDROID_HOME=/home/simulator/Android/Sdk/
simulator@ubuntu:~/go/src/github.com/golang-ui/nuklear/cmd/nk-android$ 


https://github.com/wilyarti/hashtree-ui/commit/1f8ced297ea27ec0ba838588738bcb1813448cc9

I have no got it to compile using gradle and a custom build script.

The failure to compile is due to gcc. Changing the Makefile to use clang fixes this problem.

However ant is deprecated. I used gradlew to build and install the project.