Hello, Been playing with libopusfile today. Ideally would like an MSVC dll rather than a static lib, but I can't see dllexports hidiing in an #ifdef anywhere. Am I just being stupid, or....? BTW that static lib is working nicely in vs2010 and up for streaming radio, though it was a real pain to have to piddle about compiling openssl on Windows! I want to write a streaming URL source filter for DIrectshow, and I have the baseclasses already built for VS2005, and some handy already-tested code where I could just "plug in" the libopusfile code. Hence I want to use the 2010 dll dynamically linked to a vs2005 Directshow build, as I understand building DS for 2010 is a royal pain with Windows SDK required, etc etc and I can't be doing with all that. Sadly the source doesnt compile in anything other than 2010! So, do i need to #define dllimport/export those libopusfile functions myself? I could swear Ive seen a mingw dynamic library version, and Im pretty sure mingw also requires a .def file and the #defines, so Im guessing I've just missed something here. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20140216/a242b88b/attachment.htm
r webby wrote:> So, do i need to #define dllimport/export those libopusfile functions > myself? I could swear Ive seen a mingw dynamic library version, and Im > pretty sure mingw also requires a .def file and the #defines, so Im > guessing I've just missed something here.I don't think you need the #defines, just the .def file. That file takes the place of declaring things dllexport. Declaring things dllimport merely avoids calling them through a thunk, but the number of entry points into libopusfile is small enough that this overhead is inconsequential. Easier to just avoid the whole mess of trying to decide if you're compiling the DLL or something using the DLL, etc. I believe the mingw DLLs are taking these attributes from GCC's visibility pragmas. For our other libraries, like libtheora, we've used an explicit .def file and then used that to auto-generate a linker script on other platforms, but nobody has replicated this build infrastructure for libopusfile. The pragmas were just an expedient way to get stuff going. So the short answer is: you need a .def file, but no one has made one for you yet.
Maybe Matching Threads
- Question about libopusfile downloading the last 64K when duration is not needed
- Question about libopusfile downloading the last 64K when duration is not needed
- [libopusfile PATCH] build: implement autotools build system for libopusfile.
- Question about libopusfile downloading the last 64K when duration is not needed
- [libopusfile PATCH] build: implement autotools build system for libopusfile. (v3)