Closed henning77 closed 8 years ago
Hello,
Try to do the following: go get -u /github.com/devsisters/goquic cd $GOPATH/src/github.com/devsisters/goquic ./build_libs.sh Now compile with CGO_LDFLAGS="-L$GOPATH/src/github.com/devsisters/goquic/lib/linux_amd64" go build $GOPATH/src/github.com/devsisters/goquic/example/server.go
On my machine Debian Jessie with golang1.6, I got the following error when running my QUIC server: "panic: runtime error: cgo argument has Go pointer to Go pointer" But it seems that this error is due to the Golang bug: https://github.com/golang/go/issues/14210
@Eimji I tried your sequence, but it yields the same errors. Maybe I need to change the build environment? To be exact, I am inside a Ubuntu 14.04 Docker container.
Now I tried to build on OSX, but get basically the same errors (slightly different error message). ./build_libs.sh executed successfully.
$ CGO_CFLAGS="-I$GOPATH/src/github.com/devsisters/goquic/libquic/boringssl/include" CGO_LDFLAGS="-L$GOPATH/src/github.com/devsisters/goquic/lib/darwin_amd64" go build $GOPATH/src/github.com/devsisters/goquic/example/server.go
# github.com/devsisters/goquic
Undefined symbols for architecture x86_64:
"net::CachedNetworkParameters::default_instance()", referenced from:
net::SourceAddressToken::InitAsDefaultInstance() in libquic.a(source_address_token.pb.cc.o)
"net::CachedNetworkParameters::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)", referenced from:
bool google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual<net::CachedNetworkParameters>(google::protobuf::io::CodedInputStream*, net::CachedNetworkParameters*) in libquic.a(source_address_token.pb.cc.o)
"net::CachedNetworkParameters::Clear()", referenced from:
net::SourceAddressToken::Clear() in libquic.a(source_address_token.pb.cc.o)
"net::CachedNetworkParameters::CopyFrom(net::CachedNetworkParameters const&)", referenced from:
net::CachedNetworkParameters::operator=(net::CachedNetworkParameters const&) in libquic.a(quic_crypto_server_config.cc.o)
"net::CachedNetworkParameters::MergeFrom(net::CachedNetworkParameters const&)", referenced from:
net::SourceAddressToken::MergeFrom(net::SourceAddressToken const&) in libquic.a(source_address_token.pb.cc.o)
"net::CachedNetworkParameters::CachedNetworkParameters(net::CachedNetworkParameters const&)", referenced from:
net::QuicCryptoServerStream::SetPreviousCachedNetworkParams(net::CachedNetworkParameters) in libquic.a(quic_crypto_server_stream.cc.o)
net::QuicCryptoServerStream::ProcessClientHello(net::CryptoHandshakeMessage const&, net::ValidateClientHelloResultCallback::Result const&, net::CryptoHandshakeMessage*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libquic.a(quic_crypto_server_stream.cc.o)
"net::CachedNetworkParameters::CachedNetworkParameters()", referenced from:
net::ValidateClientHelloResultCallback::Result::Result(net::CryptoHandshakeMessage const&, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, net::QuicWallTime) in libquic.a(quic_crypto_server_config.cc.o)
net::SourceAddressToken::mutable_cached_network_parameters() in libquic.a(quic_crypto_server_config.cc.o)
net::SourceAddressToken::mutable_cached_network_parameters() in libquic.a(source_address_token.pb.cc.o)
net::tools::GoQuicServerSessionBase::OnCongestionWindowChange(net::QuicTime) in libgoquic.a(go_quic_server_session_base.o)
"net::CachedNetworkParameters::~CachedNetworkParameters()", referenced from:
net::ValidateClientHelloResultCallback::Result::~Result() in libquic.a(quic_crypto_server_config.cc.o)
net::tools::GoQuicServerSessionBase::OnCongestionWindowChange(net::QuicTime) in libgoquic.a(go_quic_server_session_base.o)
"net::protobuf_AddDesc_cached_5fnetwork_5fparameters_2eproto()", referenced from:
net::protobuf_AddDesc_source_5faddress_5ftoken_2eproto() in libquic.a(source_address_token.pb.cc.o)
"net::CachedNetworkParameters::ByteSize() const", referenced from:
int google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual<net::CachedNetworkParameters>(net::CachedNetworkParameters const&) in libquic.a(source_address_token.pb.cc.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Turned out the issue was that I built from a shared folder inside my VM (shared with host). I started from scratch on a folder inside the VM and now it works.
I'm glad to hear it :+1:
I tried to build example/server.go with the following options:
CGO_CFLAGS="-I$GOPATH/src/github.com/devsisters/goquic/libquic/boringssl/include" CGO_LDFLAGS="-L$GOPATH/src/github.com/devsisters/goquic/lib/linux_amd64" go build $GOPATH/src/github.com/devsisters/goquic/example/server.go
Result:
I'm on linux + go1.6. Previously I have build the static libs with ./build_libs.sh, without problem.