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

Opus codec build instructions only support Linux and not Windows #275

Open
Ori248 opened this issue Apr 23, 2023 · 4 comments
Open

Opus codec build instructions only support Linux and not Windows #275

Ori248 opened this issue Apr 23, 2023 · 4 comments

Comments

@Ori248
Copy link

Ori248 commented Apr 23, 2023

Hello. I am a Windows user trying to compile the Opus codec in order to execute specific functions from a Python script. I've used the Windows Subsystem for Linux (WSL) to build the Opus source code using the instructions given here, and I succeeded, but the final resulting libraries are .so files, which work for Linux but not Windows. I would like to ask for help in enabling the creation of DLLs instead of .so files, in order to enable building Opus on Windows and using is as a DLL. Any help is welcomed. Thanks in advance!

@Ori248 Ori248 changed the title Build instructions only support Linux and not windows Opus codec build instructions only support Linux and not windows Apr 23, 2023
@Ori248 Ori248 changed the title Opus codec build instructions only support Linux and not windows Opus codec build instructions only support Linux and not Windows Apr 23, 2023
@xnorpx
Copy link
Contributor

xnorpx commented Apr 23, 2023

Install Visual studio 2022
Install CMake

Start a x64 Native Tools Command Prompt for VS 2022 (important don't ignore this step)
You can find it in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2022\Visual Studio Tools\VC

git clone https://github.com/xiph/opus
cd opus
mkdir build
cd build
cmake .. -DOPUS_BUILD_SHARED_LIBRARY=ON
cmake --build . -j 8 --config Release

@Ori248
Copy link
Author

Ori248 commented Apr 23, 2023

I'll try that, thanks!

@Ori248
Copy link
Author

Ori248 commented Apr 24, 2023

I'm actually struggling with this. When trying to execute this line from your answer: cmake .. -DOPUS_BUILD_SHARED_LIBRARY=ON, I get the following error: CMake Error at CMakeLists.txt:7 (project):
No CMAKE_C_COMPILER could be found. What does it mean? How can I resolve it?

@rillian
Copy link
Contributor

rillian commented May 5, 2023

It means cmake couldn't find a working C compiler. Make sure you have Microsoft Visual Studio installed, with support for the C/C++ languages and the current Windows SDK. Make sure you're running cmake from a command shell with the appropriate environment, e.g. "x64 Native Tools Command Prompt for VS 2022".

This post has a few other strategies to try.

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

3 participants