go static build error
See original GitHub issueDescribe the bug Pulsar version: 2.3.0 dpkg -i apache-pulsar-client*.deb
To Reproduce go build -a -ldflags ‘-extldflags “-static”’ .
Expected behavior build success
Desktop (please complete the following information): go version go1.11.5 linux/amd64 gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Additional context Some error output:(error log is long,i will upload if needed.)
# command-line-arguments
/home/tevic/WorkSpace/RunTime/Go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-849858481/000024.o: In function `_cgo_18049202ccd9_C2func_getaddrinfo':
/tmp/go-build/cgo-gcc-prolog:49: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libpulsar.a(ExecutorService.cc.o): In function `void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) [clone .isra.150]':
/usr/include/c++/6/bits/basic_string.tcc:212: undefined reference to `std::__throw_logic_error(char const*)'
/usr/include/c++/6/bits/basic_string.tcc:219: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libpulsar.a(ExecutorService.cc.o): In function `pulsar::ExecutorService::close()':
/usr/include/c++/6/bits/unique_ptr.h:76: undefined reference to `operator delete(void*)'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libpulsar.a(ExecutorService.cc.o): In function `pulsar::ExecutorService::~ExecutorService()':
/usr/include/c++/6/bits/unique_ptr.h:76: undefined reference to `operator delete(void*)'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libpulsar.a(ExecutorService.cc.o): In function `pulsar::ExecutorService::~ExecutorService()':
/usr/local/include/boost/asio/impl/io_service.ipp:53: undefined reference to `operator delete(void*)'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libpulsar.a(ExecutorService.cc.o): In function `pulsar::ExecutorServiceProvider::ExecutorServiceProvider(int)':
/usr/include/c++/6/ext/new_allocator.h:104: undefined reference to `operator new(unsigned long)'
/usr/include/c++/6/ext/new_allocator.h:102: undefined reference to `std::__throw_bad_alloc()'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libpulsar.a(ExecutorService.cc.o): In function `pulsar::ExecutorService::ExecutorService()':
/usr/local/include/boost/asio/impl/io_service.ipp:39: undefined reference to `operator new(unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libpulsar.a(ExecutorService.cc.o): In function `pulsar::ExecutorService::ExecutorService()':
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
go - Cannot build with static link - Stack Overflow
I'm trying to build a go program with static link. I want to run this on a different system, with different version of...
Read more >cmd/go: can't build a static binary since Go 1.15 · Issue #40711
it is statically linked but not PIE. If I use something like this: go build -buildmode=pie -ldflags '-extldflags "-static"' it is PIE ...
Read more >Statically compiling Go programs - arp242.net
Go creates static binaries by default unless you use cgo to call C code, in which case it will create a dynamically linked...
Read more >Linking static c++ library with Go using SWIG - Google Groups
I have to use a static library, wrote in C++ in a go project. I have the libcolor.a and the COLOR.h ... I...
Read more >"Internal Error - A stack overflow error has occurred ... - TI E2E
When compiling a static library project with CCS v11.2.0 ... If I then try "Build Project" again, I get the "Internal Error" message...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve figure out a workaround: 1.install the requirements for build cpp client 2.build cpp client, finally make install 3.download curl source build and install, with specific build flags:
4.build your go code use command like this:
It is quite complex and is there any simple method?
Closed as stale. The new client-go is implemented in pure go and is located at https://github.com/apache/pulsar-client-go.
Feel free to create an issue there if more issues found.