0

I am trying to make a custom microsip project. But, it gives me the error of

LNK1104, cannot open file opus.lib

I don't have the lib, nor I can find it online. I have downloaded from https://www.opus-codec.org/downloads/, but can't make the build out of it. How am I suppose to? there are just some .exe files and html files.

Rup
  • 33,765
  • 9
  • 83
  • 112
Mehdi Raza
  • 53
  • 1
  • 7
  • I don't have the lib, nor I can find it online – Mehdi Raza Dec 24 '20 at 12:18
  • yes, I am referring to opus codec. – Mehdi Raza Dec 24 '20 at 12:19
  • Looks like you just need the binary version right? No exactly build the lib. You can download from here: https://www.opus-codec.org/downloads/ – Edgar Dec 24 '20 at 12:21
  • I have downloaded from there, but can't make the build out of it. How am I suppose to? there are just some .exe files and html files – Mehdi Raza Dec 24 '20 at 12:23
  • No, the Windows binary distribution is encoder and decoder .exes not the .lib. It looks like you want the source distribution, then you'll have to build the .lib yourself from the project file there in the win32 directory. – Rup Dec 24 '20 at 12:24
  • win32 directory? I don't get it? I have an error when I want to modify microsip code, the error is of link error, so I thought I might need .lib file, but instead now I understand that I have to make .lib myself by building it? but how to build it? what do you mean by win32 directory ? – Mehdi Raza Dec 24 '20 at 12:26
  • This is not a duplicate of "Why does fatal error LNK1104 occur" because this isn't about linker misconfiguration, it's about not having the file to link against in the first place. – Rup Dec 25 '20 at 17:21

1 Answers1

1

It doesn't look like there's a binary distribution of the Opus .lib for Windows, only pre-built encoder and decoder tools, so you'll have to build it yourself.

  1. Get the source code, either
  2. In your checkout or extracted copy of the code there will be a 'win32' folder. Open win32\VS2015\opus.sln in Visual Studio and build it. You'll probably have to click through a few dialogs to upgrade the project build tools to the version you're using, but that's a good thing to do. You may need both debug and release builds depending on what you're making.

You'll now have .libs in the Opus source checkout in win32\VS2015\Win32\Debug and \Release that you can use in your project. (You could also add the Opus project into your solution and make your SIP project depend on it.) You'll need to add the paths to these folders to your project linker settings.

Rup
  • 33,765
  • 9
  • 83
  • 112
  • However if you're trying to link against opus.lib you must already have opus.h from somewhere. I'm surprised you don't also have the .lib from wherever you got that. – Rup Dec 24 '20 at 12:31
  • There is error while building it, ogg.h not found! – Mehdi Raza Dec 28 '20 at 05:49
  • first ogg.h then opusmultistream.h and now openssl/ssl.h and further, it keeps going on! why is there so much dependency issue? it needs some .h files now? am I doing something wrong? – Mehdi Raza Dec 28 '20 at 06:22
  • FINALLY SOLVED, but I had to clone opus from this url https://github.com/xiph/opus and then I build it, there wasn't any issue there. – Mehdi Raza Dec 28 '20 at 10:04
  • Glad to hear it! FWIW building from the source download .zip worked fine for me too. – Rup Dec 28 '20 at 11:00
  • Honored! Thanks for the help – Mehdi Raza Dec 28 '20 at 11:09