You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried importing github.com/pion/mediadevices/pkg/codec/opus.
What did you expect?
Successful compilation.
What happened?
Initially, I got the following error:
# github.com/pion/mediadevices/pkg/codec/opus
vendor/github.com/pion/mediadevices/pkg/codec/opus/opus.go:17:10: fatal error: opus.h: No such file or directory
17 | #include <opus.h>
| ^~~~~~~~
compilation terminated.
After realizing that the package couldn't seem to locate opus.h, I tried to add #cgo pkg-config: opus above the include and got the following new error:
# github.com/pion/mediadevices/pkg/codec/opus
/usr/bin/ld: cannot find vendor/github.com/pion/mediadevices/pkg/codec/opus/lib/libopus-linux-x64.a: No such file or directory
collect2: error: ld returned 1 exit status
Note: I had already installed the dependencies using sudo apt-get install libopus-dev libopus0 opus-tools.
I suspect the initial issue happened because the package is within the vendor directory, not sure if I'm supposed to somehow use the Makefile within the codec/opus package. The second issue I guess happened because I don't seem to have libopus-linux-x64.a. Not sure if this is already documented somewhere? Any help would be appreciated!
Also, fyi, I could successfully compile examples/webrtc when I git clone this repository (which imports the codec/opus package). I only encounter this compilation error when importing mediadevices into my own project, where the package would be placed under vendor directory.
The text was updated successfully, but these errors were encountered:
santiagos01
changed the title
Compile error when using codec/opus in Ubuntu
Compile error when using codec/opus in Ubuntu 22.04
Sep 14, 2022
Your environment.
What did you do?
I tried importing
github.com/pion/mediadevices/pkg/codec/opus
.What did you expect?
Successful compilation.
What happened?
Initially, I got the following error:
After realizing that the package couldn't seem to locate
opus.h
, I tried to add#cgo pkg-config: opus
above the include and got the following new error:Note: I had already installed the dependencies using
sudo apt-get install libopus-dev libopus0 opus-tools
.I suspect the initial issue happened because the package is within the
vendor
directory, not sure if I'm supposed to somehow use theMakefile
within thecodec/opus
package. The second issue I guess happened because I don't seem to havelibopus-linux-x64.a
. Not sure if this is already documented somewhere? Any help would be appreciated!Also, fyi, I could successfully compile
examples/webrtc
when I git clone this repository (which imports thecodec/opus
package). I only encounter this compilation error when importingmediadevices
into my own project, where the package would be placed undervendor
directory.The text was updated successfully, but these errors were encountered: