x/mobile: No type or protocol named 'goSeqRefInterface' #17482
Comments
cc @eliasnaur |
The |
Modules appear to be enabled. Certainly nothing has changed apart an update to gomobile. |
The bind generators have started to use the @import module import syntax, which explains why it fails for you by just upgrading gomobile. However, it should work as long as modules are enabled in your project. Do the golang.org/x/mobile/example/bind/ios example work for you? I ran
in that directory and dragged the resulting Hello.framework into the example project. The example then ran fine in the emulator. |
OK I've found the issue. I was calling my go code from *.mm file. Which despite project settings disables modules. I moved to using a *.m file and my project compiles. Probably worth calling that out in the docs. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.1 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/michaelayles/Documents/Melrose/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/d2/vr1s6x2j30d52plx6fgy0h480000gn/T/go-build939087427=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
What did you do?
If possible, provide a recipe for reproducing the error.
I've downloaded the latest gomobile version following the instructions online. The version I have now is "gomobile version +2ea7e2c Mon Oct 17 14:21:52 2016 +0000 (android,ios); androidSDK="
I'm trying to build a framework for iOS, which succeeds. But compiling and running against an iOS app fails.
The generated interface contains references that are not defined anywhere.
Error 1: Use of '@import' when modules are disabled
Multiple Errors for every: GoUniverse.h:22:39: No type or protocol named 'goSeqRefInterface'
Example. I've defined a struct in Go:
This generates an interface as this...
This doesn't compile.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
Should compile. Previous version of goMobile didn't use goSeqRefInterface. Output was:
What did you see instead?
Doesn't compile.
The text was updated successfully, but these errors were encountered: