Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error when using codec/opus in Ubuntu 22.04 #442

Open
santiagos01 opened this issue Sep 14, 2022 · 0 comments
Open

Compile error when using codec/opus in Ubuntu 22.04 #442

santiagos01 opened this issue Sep 14, 2022 · 0 comments

Comments

@santiagos01
Copy link

santiagos01 commented Sep 14, 2022

Your environment.

  • Version: v0.3.11
  • Browser: (none)
  • OS: Ubuntu 22.04
  • Go version: 1.18

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:

# 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.

@santiagos01 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant