Server (linux) integrated into golang (cgo) compile error #2234
Replies: 17 comments
-
Make cmd: |
Beta Was this translation helpful? Give feedback.
-
can you check the Dockerfile? it looks like it's missing clang to build wallet core first |
Beta Was this translation helpful? Give feedback.
-
In the Source code (zip) package used by the dockerfile, no modification |
Beta Was this translation helpful? Give feedback.
-
yeah, you need to build wallet core first to use it in golang |
Beta Was this translation helpful? Give feedback.
-
yeah,I have built these 3 static library files needed by cgo with dockerfile |
Beta Was this translation helpful? Give feedback.
-
Can you check if you have installed |
Beta Was this translation helpful? Give feedback.
-
#cgo in the service.go file These two files are not found in the system, how to install on centos? Can you give me a hint? Thanks! |
Beta Was this translation helpful? Give feedback.
-
I found these two files in the docker environment (Ubuntu), I wonder if they can be copied to the centos environment for use? Or does it need to be reinstalled in the centos environment? root@35ae9c590d9d:/wallet-core/# find / -name "libc++abi1" root@35ae9c590d9d:/wallet-core# find / -name "libc++1" |
Beta Was this translation helpful? Give feedback.
-
Try the following installation, the installation did not report an error, but after installation, the two words were not found. [root@dev project]# yum -y install clang
|
Beta Was this translation helpful? Give feedback.
-
They're called |
Beta Was this translation helpful? Give feedback.
-
I have tried the following methods, but the installation was not successful. Due to time constraints, I have to give up the cgo method for the time being and use the golang shell to call the C module. https://stackoverflow.com/questions/39332406/install-libc-on-ubuntu |
Beta Was this translation helpful? Give feedback.
-
https://developer.trustwallet.com/wallet-core/integration-guide/server-side You might want to copy and run main outside of the docker container, make sure you have libc++1 and libc++abi1 installed in your host Ubuntu. I compiled the sample (golang version) from the docker environment and copied it to the centos environment. It works normally. In the centos environment, the dependencies of the cgo-dependent library "-lTrustWalletCore -lprotobuf -lTrezorCrypto -lstdc++ -lm" are normal, but the compilation time this error, [root@ project]# ldd main [root@project]# ./main |
Beta Was this translation helpful? Give feedback.
-
GO111MODULE=on GOOS=linux CGO_ENABLED=1 CC="/usr/bin/clang-12" CXX="/usr/bin/clang++-12" go build -a -v -mod=vendor ${GCFLAGS} ${LDFLAGS} -o build/${APPLICATION} ${CMD} I tried to specify CC and CXX to clang in the makefile, the error "#if __has_feature(assume_nonnull)" was not reported, but the following error was reported,looks like a symbol problem : /root/project/TrustWalletCore-v2.8.0-linux-for-go/libTrustWalletCore.a(Signer.cpp.o): In function |
Beta Was this translation helpful? Give feedback.
-
can you build your app inside docker container? or try link |
Beta Was this translation helpful? Give feedback.
-
If my application is built in docker, it is a little inconvenient to deploy try link -lcxx make cmd: cgo: Report not found library error: |
Beta Was this translation helpful? Give feedback.
-
not familiar with CentOS, if |
Beta Was this translation helpful? Give feedback.
-
have already tried... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Server (linux) integrated into golang (cgo) compile error
TrustWalletCore library version: v2.8.0, based on the source code docker build
Project environment OS:CentOS Linux release 8.3.2011
Golang version: go version go1.18.1 linux/amd64
In file included from /root/project/include/TrustWalletCore/TWCoinType.h:9,
from /root/project/include/TrustWalletCore/TWHDWallet.h:10,
from service/service.go:6:
/root/project/include/TrustWalletCore/TWBase.h:50:18: error: missing binary operator before token "("
#if __has_feature(assume_nonnull)
^
/root/project/include/TrustWalletCore/TWBase.h:59:19: error: missing binary operator before token "("
#if !__has_feature(nullability)
Beta Was this translation helpful? Give feedback.
All reactions