Tevic edited a comment on issue #3680: go static build error
URL: https://github.com/apache/pulsar/issues/3680#issuecomment-469095914
 
 
   > > 4.build your go code use command like this:
   > > ```
   > > CGO_CPPFLAGS="-I/usr/local/include -I/usr/include" 
CGO_LDFLAGS="-L/usr/local/lib -L/usr/lib -lcurl -lssl -lcrypto -lcrypto -lz 
-lpulsar -lstdc++ -lboost_system -lboost_regex -lprotobuf -ldl" go build 
-ldflags '-extldflags "-static"' hello.go
   > > ```
   > > It is quite complex and is there any simple method?
   > 
   > In my local area, I only need to build cpp-client, I have not run this 
step, and go-client can also run normally.
   
   If you only use `go build xxx.go` without any arguments, go will  build your 
program which runs rely on libpulsar.so, which means you need to copy 
libpulsar.so to every machine you run this program. But in my way, all 
dependencies will in one binary.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to