ogg
ogg copied to clipboard
library prefix in MSVC files.
Hello,
currently the MSVC project files define a lib
prefix for the ogg library, leading to a libogg.dll
shared library, a libogg.lib
import library and a libogg_static.lib
static library. This is inconsistent with the output generated by CMake, which in the current configuration creates a ogg.dll
shared library, a ogg.lib
import library and a ogg.lib
static library.
But how to fix this? It's possible to change the MSVC projects or to set the prefix in the CMake configuration. The lib prefix isn't removed by the linker during runtime linking so one would always need to link against libogg
on windows, making it inconsistent across platforms where you link against ogg
, making cross platform builds a bit harder (eg. you would need to update the CMakelists.txt of the vorbis project to search for libogg too instead of just searching for ogg). On the other hand it would break compatibility in the sense that clients who use libogg in their project file, causing link error until the linker dependency is changed from libogg.lib to ogg.lib.
The CMake build files are quite new, so I would guess most projects use the libogg name. In addition, on Linux, it's also libogg. I think changing CMakelists.txt in both Ogg and Vorbis is probably sensible. Other users of Ogg (Opus and Theora) have no cmake support at all.
@adrianbrohe Cannot reproduce issue. Tested and confirmed resolved.
Same here.
The ogg.def file defines the library as LIBRARY ogg
, whereas the project (libogg.vcxproj) defines it as <RootNamespace>libogg</RootNamespace>
.
Thus the dynamic library is called libogg.dll
while the linking lib (libogg.lib) points to a nonexistant ogg.lib
.
That makes it impossible to link the correct dll without renaming it.