Compiling libogg and libvorbis on Windows for Dummies
I don’t have much experience with Visual Studio (I’m a linux/gcc person) so I wasted a few hours messing around to get this to work. Hopefully this’ll save someone some time.
Procedure
libogg
-
Download Visual Studio 2019 Community installer from https://visualstudio.microsoft.com/downloads/
-
Install Visual Studio 2019 Community, selecting the “Desktop Development with C++ option”

-
Download
liboggandlibvorbisfrom https://xiph.org/downloads/, extracting to the same folder.libogg-x.y.zandlibvorbis-x.y.zfolders should be side-by-side. -
Open
libogg-x.y.z/win32/VS2015/libogg.sln. if there is an error saying that the project was not loaded, close Visual Studio and re-open.
-
If prompted, accept the upgrade to Platform Toolset v142 and Windows SDK 10.0 (latest installed version). If no prompt appears, you can retarget to those options by right-clicking on
liboggin theSolution Explorerpane, or by using the Project menu:Project>Properties>All Configurations, All Platforms>Windows SDK Version & Platform Toolset.
-
Select Configuration and Platform in the toolbar up top. Select
Debug/Releaseif you need a.libto link against statically. SelectDebugDLL/ReleaseDLLif you need a.dllto link against dynamically.Win32if you need 32-bit, otherwisex64. -
Build!
libvorbis
You’ll need libogg to compile libvorbis, so make sure all the steps above are completed.
-
Edit
libvorbis-x.y.z/win32/VS2010/libogg.props, check that theLIBOGG_VERSIONis the same as what you’ve downloaded. -
Open
libvorbis-x.y.z/win32/VS2010/vorbis_{dynamic,static}.sln. If you need a.lib, choosevorbis_static.sln. If you need a.dll, choosevorbis_dynamic.sln. -
Similar to
libogg, accept the upgrade or retarget. -
Select Configuration and Platform. Since the solution files are different this time, there’s only two configurations:
Debug/Release. -
Build! If there’s an error when building that says
cannot open file libogg.lib, you’ll need to compile the staticliboggfirst - make sureliboggis compiled for the sameDebug/Releaseand same platform that you want to compilelibvorbisfor.