Building simple iOS app on OSX

Issue #2 resolved
Peter Kieltyka created an issue

Hello,

I'm trying to build this very simple app after compiling goios:

package main

import (
    "log"
    "golang.org/x/mobile/app"
)

func main() {
    app.Run(app.Callbacks{
        Draw: draw,
    })
}

func draw() {
    log.Print("In draw loop, can call OpenGL.")
}

In the goios/bin folder, I placed the main.go file. I have the golang.org/x/mobile/app package in my $GOPATH and I run:

$ CGO_ENABLED=1 GOARCH=arm ./go build`
# golang.org/x/mobile/gl
../../../go/src/golang.org/x/mobile/gl/gl.go:29:10: fatal error: 'OpenGL/gl3.h' file not found
#include <OpenGL/gl3.h>
         ^
1 error generated.

.. what am I doing wrong here..? the OpenGL headers are in /System/Library/Frameworks/OpenGL.framework/

it would be great to have a note about how to get a simple example running with goios. And also, thank you for this work! I'm very excited to see it prosper!

Comments (2)

  1. minux repo owner

    You haven't done anything wrong.

    The x/mobile repository doesn't yet support darwin/arm yet, sorry. (It should include the OpenGLES header, not the OpenGL header, which is only for the desktop)

    crawshaw told me that he has got the OpenGL package working on iOS, so after the port is included in the official Go tree, I expect the iOS support of x/mobile should be available too.

  2. Log in to comment