devsisters / gospdyquic

SPDY/QUIC support for Go
BSD 3-Clause "New" or "Revised" License
38 stars 5 forks source link

error on build on OSX #1

Open joeblew99 opened 9 years ago

joeblew99 commented 9 years ago

Could you help me out. The build script is being run and i get this error. Here is the terminal:

devsisters apple$ CGO_LDFLAGS="-L$GOPATH/src/github.com/devsisters/goquic/lib/darwin_amd64" go build $GOPATH/src/github.com/devsisters/gospdyquic/example/server.go

github.com/devsisters/goquic

goquic/init.go:10:30: error: unknown type name 'CRYPTO_THREADID' extern void goquic_thread_id(CRYPTO_THREADID *id); ^ 1 error generated.


BTW the path on the readme is wrong. Is missing the "src" before /github.com/....

serialx commented 9 years ago

Hello! Thank you for reporting this problem. Due to recent thread safety related patch to goquic, a working OpenSSL header is needed. We are still figuring out how we can deal with this new dependency.

Normally this would not be a problem because many developers have OpenSSL installed. But it seems you are using an older version of OpenSSL which does not have CRYPTO_THREADID type in the header. (You need at least OpenSSL 1.0.0) So you have two options.

  1. You can install latest OpenSSL to mitigate this problem: brew install openssl
  2. Fortunately, libquic repository has a latest version of BoringSSL, which includes all the headers you need. (And we link to BoringSSL anyways) So setting CGO_CFLAGS environment variable to the BoringSSL repository will solve this problem. Example: CGO_CFLAGS="/path/to/boringssl/include/" CGO_LDFLAGS="-L$GOPATH/src/github.com/devsisters/goquic/lib/darwin_amd64" go build $GOPATH/src/github.com/devsisters/gospdyquic/example/server.go
serialx commented 9 years ago

I've updated the README to add CGO_CFLAGS environment variable. Can you try it out and see if it works?

Thanks!