1

First, going to be honest. I'm a c#/java-language-level dweller. So I have no idea about how to compile native-C projects such as opus.

I've tried doing it myself, and I've tried googling it. I simply need help compiling the opus-codec API (on Windows).

Once I have the library compiled, I'll build a wrapper for it's API. While my searches have indeed found opus wrappers targeting my current project's language (c#), I can't find an up-to-date one. I don't know if it matters, but I need it for it's VoIP capabilities.

Sorry for my stupidity in the matter.

[UPDATE]

After compiling with Visual Studio 2010: Ultimate, I have a .lib library file. I need a .dll. I don't know what I'm doing. Help?

RoyalPotato
  • 515
  • 4
  • 15

1 Answers1

1

In a C project there is going to be some way to drive a build of all the object files, libraries, etc. Basically the same thing as maven build in Java, just with different tools. You will have to have the right tools if you don't.

On unix systems it's usually Makefile driven, running command line programs that compile and link the program or library that is being built. In GUI environments like XCode or Visual Studio, there are ways to run the build directly from the UI.

Looking at the source tree, there's a directory with a number of Visual Studio 2010 projects in it - https://git.xiph.org/?p=opus.git;a=tree;f=win32/VS2010

If you're using Visual Studio, loading that up and trying a build to see if it still works is where I'd start. Or perhaps have a look at Any way to do Visual Studio "project only" build from command line? or other questions that reference msbuild.

Community
  • 1
  • 1
anomie-p
  • 61
  • 1
  • 6
  • Compiling with VS2010 worked. The reason I didn't try to do this first is because this is my second attempt at opus, the first time (about a year-ago) vs10 spit out several hundred errors at me. – RoyalPotato Mar 17 '16 at 18:48
  • However, now all I've got is a .lib and not my required .dll. I think they really prefer you to use linux tools to build opus, as well. But as long as VS2010 works, I'm not going to take that road. – RoyalPotato Mar 17 '16 at 18:50
  • @RoyalTomato there should be a linker flag to build a dll, you may need to just add it, or copy whatever bit is building the .lib, add the right link flags, and change to the correct file extension. – anomie-p Mar 17 '16 at 19:06
  • You can also try: make a new project, setting the application type as DLL, then set the include directory for that project to the 'include' directory in the source tree, add in the source (using the project that builds the .lib as a sort of reference if you need to), then build the new .dll project. Switching the working build to generate a .dll may be easier. – anomie-p Mar 17 '16 at 20:05
  • Went into the project properties in visualstudio and told it to output a dynamic link library instead of a static library. Then changed the output extension from .lib to .dll. It errored on build and iirc said something like "Failed to find celt.dll", celt is another project within the opus-package. It too has a visual studio project within the solution. – RoyalPotato Mar 19 '16 at 19:29
  • I ran into the same thing, but didn't have a lot of time to mess with it. You may be able to get something *quickly* by doing the following : a) make your own dll project (empty) b) Pull the .lib files you need from the build that is working in so your dll project will link against them c) make sure the headers are in the include path in your project, d) write small wrappers around the functions / etc you want to use and make sure they're exported from your dll that you are building. If you intend to use a small number of functions, etc, this may get you there quickly. – anomie-p Mar 19 '16 at 19:48
  • I'm afraid I had intended on having the entire opuslibrary in a .dll. Obviously doing this for every function, while do-able, would be a pain. Any more ideas before I take that route? – RoyalPotato Mar 19 '16 at 19:51
  • You can try converting the subprojects over to dll individually (go into Celt project, convert it to dll, if it depends on others convert those, until you get the lowest dependency compiling, then start moving up) - you may or may not need .def files to tell it to export from the dll – anomie-p Mar 19 '16 at 21:23
  • Tried setting celt to dynamiclinklibrary already. Celt compiled, but opus says "error LNK1104: cannot open file 'celt.lib'". Obviously opus has a reference to the specific file somewhere, but once again, I have no business even trying to compile opus, so I don't have a clue about how these kinds of dependencies work. – RoyalPotato Mar 20 '16 at 02:36
  • Change what opus is pulling in from .lib to .dll – anomie-p Mar 20 '16 at 03:06
  • In Project Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies, I changed Celt's entry, 'celt.lib' to 'celt.dll', and now it says it can't find 'celt.dll'. Checked the files in explorer and it's there. – RoyalPotato Mar 20 '16 at 03:18