You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The short version: The #ifndef lines in the generated headers are preventing the inclusion of the Hello.objc.h content. (Which causes compile errors in a project that tries to use the framework.)
Now look at the generated headers inside the Hello.framework directory.
Hello.h:
// Objective-C API for talking to the following Go packages//// golang.org/x/mobile/example/bind/hello//// File is generated by gomobile bind. Do not edit.
#ifndef __Hello_H__
#define__Hello_H__
#include"Hello.objc.h"
#include"Universe.objc.h"
#endif
Hello.objc.h:
// Objective-C API for talking to golang.org/x/mobile/example/bind/hello Go package.// gobind -lang=objc golang.org/x/mobile/example/bind/hello//// File is generated by gobind. Do not edit.
#ifndef __Hello_H__
#define__Hello_H__
@import Foundation;
#include"Universe.objc.h"
FOUNDATION_EXPORT NSString* HelloGreetings(NSString* name);
#endif
Note that the two files have the same #ifndef/#define lines. This effectively removes the content of the Hello.objc.h file, causing errors when trying to use the framework.
I don't have a fix for this, but I believe the bug was introduced in golang/mobile@6a96d4c. (Perhaps it was always present with a default prefix.)
Workaround: Use the -prefix flag. The prefix will end up in the #ifndef symbol.
The text was updated successfully, but these errors were encountered:
Fix manually verified; none of our tests or the hello example fails
without this fix.
While we're here, update the hello iOS example to actually include the
Hello.framework and to use module @import syntax.
Fixesgolang/go#18693
Change-Id: Id2edf80e2ed9ed8060ec825369a64f276a3b3c1d
Reviewed-on: https://go-review.googlesource.com/35330
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat
pushed a commit
to imWildCat/go-mobile
that referenced
this issue
Apr 11, 2021
Fix manually verified; none of our tests or the hello example fails
without this fix.
While we're here, update the hello iOS example to actually include the
Hello.framework and to use module @import syntax.
Fixesgolang/go#18693
Change-Id: Id2edf80e2ed9ed8060ec825369a64f276a3b3c1d
Reviewed-on: https://go-review.googlesource.com/35330
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The short version: The
#ifndef
lines in the generated headers are preventing the inclusion of theHello.objc.h
content. (Which causes compile errors in a project that tries to use the framework.)What version of Go are you using (
go version
)?go version go1.7.4 darwin/amd64
What did you do?
Get and install current gomobile master (currently golang/mobile@c4d780f).
Compile the iOS bind example (golang/mobile/example/bind/ios).
Now look at the generated headers inside the
Hello.framework
directory.Hello.h
:Hello.objc.h
:Note that the two files have the same
#ifndef
/#define
lines. This effectively removes the content of theHello.objc.h
file, causing errors when trying to use the framework.I don't have a fix for this, but I believe the bug was introduced in golang/mobile@6a96d4c. (Perhaps it was always present with a default prefix.)
Workaround: Use the
-prefix
flag. The prefix will end up in the#ifndef
symbol.The text was updated successfully, but these errors were encountered: