Closed Jinxiansen closed 5 years ago
why gomobile? you can use native swfit / java wallet core bindings. could you please join https://t.me/walletcore ? for such questions?
TelegramPublic discussion for Trust Developers. Documentation available: developer.trustwallet.com Add new blockchain: developer.trustwallet.com/wallet-core/newblockchain
@hewigovens
Because we already have a Golang framework
file, and we only have access to several currencies.
In addition, when I looked at the information of .a, I found that it was the architecture of x86_64 bit, which should be used for 64-bit computers.
Non-fat file: libTrustWalletCore.a is architecture: x86_64
And what we need is the arm64 architecture on the phone. I don't know how to modify the source code so that the compiled .a is arm64?
run tools/ios-build
Prompt C++ method error in iOS.
Did you link the lib properly?
Yes. And in the golang project, the C++ compiled .a file was introduced, and the jar/aar package was not available on Android via gomobile because the .a static library could not be recognized.
Other than that, I don't know what else can be used to introduce wallet-core C++ projects for use in golang. The most stupid way is to refer to the C++ code and rewrite it in Golang.🤔
@hewigovens
Hello,Is it supported to compile C++ source code into so
library and then call it in golang.
You need to change the CMakeList.txt to produce shared library, the file size would be huge, I don't understand why you choose this approach, if you eventually call it on mobile, the best way is to use our prebuilt swift/java library.
The only reasonable way to use it in golang is server side, like address encoding etc.
Hello! when I imported the
C++
compiled 3.a
files into a golang project and packaged them via golang'sgomobile bind -target=ios .
command line, I got several errors like this:The main mistakes are: 1.
The above error seems to be a problem with the support of the CPU architecture. We only need to support 64-bit systems. What do we need to do during the compilation process?
2.
This seems to be a method conflict, but I didn't find it in wallet-core, I don't know how to modify it to avoid conflicts with these files in my project.