x/mobile/cmd/gomobile: c++ library on mac #12948
Comments
Thanks, that's surprising. It's probably worth setting that by default. Would you like to send a CL, or rather I do it? |
I am wondering whether there is any advantage of keep using the system default, libstdc++, given the fact that libc++ and libcstd++ are not ABI compatible. |
if we keep libc++ as default, we need to document somewhere which tells that we always need to use @crawshaw I will send a CL and also think how to add a unittest. Is it ok to add a test by linking cgo and gomobile? In my case, I use https://github.com/jmhodges/levigo and https://github.com/google/leveldb |
@hsinhoyeh adding test sounds great. Just don't depend on 3rd party repositories; instead come up with minimal cgo examples. |
CL https://golang.org/cl/16466 mentions this issue. |
Is this a problem? Perhaps the default std. c++ runtime has changed with newer iOS SDKs. |
hi,
I am working on build c/c++ library with cgo into ios platform (by gomobile)
when I run go bind -target=ios, you actually build three environments:
https://github.com/golang/mobile/blob/master/cmd/gomobile/bind_iosapp.go#L49
and it turns out that "by default" darwinArmEnv and darwinArm64Env use libc++ library, while darwinAmd64Env use libstdc++.
the following workaround works for me:
I think it is better to allow CXXFLAGS can be passed when build.
The text was updated successfully, but these errors were encountered: