keroserene / go-webrtc

WebRTC for Go
Other
455 stars 76 forks source link

compilation error (file not found) #67

Closed Inuart closed 7 years ago

Inuart commented 7 years ago

I am not able to install go-webrtc by just using go install

go version go1.9beta2 linux/arm64

go install github.com/keroserene/go-webrtc
# github.com/keroserene/go-webrtc
ctestenums.cc:2:48: fatal error: webrtc/api/peerconnectioninterface.h: No such file or directory
compilation terminated.

Could you provide more info? like how to include the include folder for cgo?

arlolra commented 7 years ago

What are you trying to install? go-webrtc doesn't export a main function that would compile to a binary.

Did you mean to do go get instead?

Inuart commented 7 years ago

I tried to run the demo code with go run demo/chat/chat.go and failed. Then saw the same error after trying with go install so I assumed it was a compilation error.

Inuart commented 7 years ago

Could you provide more detailed build instructions? The readme only states

The easy way is to use the pre-built archive I've provided in lib/.

Once the archive is ready, cgo takes care of everything, and building is as easy as go build or go install.

However, at least on macOS, attempting to do so will result in this error message:

# pkg-config --cflags webrtc-darwin-amd64.pc webrtc-darwin-amd64.pc
pkg-config: exec: "pkg-config": executable file not found in $PATH

And after adding the pkg-config in github.com/rjeczalik/pkgconfig (is this a valid pkg-config?):

# pkg-config --cflags webrtc-darwin-amd64.pc webrtc-darwin-amd64.pc
error github.com: PKG_CONDIF_GITHUB not exported, skipping github.com lookup
error $PKG_CONFIG_PATH: open webrtc-darwin-amd64.pc.pc: no such file or directory
error <autogenerated>: no library found in $GOPATH: webrtc-darwin-amd64.pc
error $GOPATH: no library found in $GOPATH: webrtc-darwin-amd64.pc

I find the reference to webrtc-darwin-amd64.pc.pc suspicious but not sure how to proceed.

arlolra commented 7 years ago

Try https://brew.sh/

brew install pkg-config