xiph/ogg

ogg.def problem with mingw-w64

mipac opened this issue · 4 comments

mipac commented

when compile with cmake/mingw64 with msys2 shell
ogg.def is used
LIBRARY must be set to libogg, and then the executables will looking for libogg.dll, and not ogg.dll like now

flac and opus don't use a .def, and it works fine
is it necessary to use ogg.def for win32?

install msys2 from msys2.org
install mingw64 toolchain, mingw64 cmake

git clone opus in a dir ......src/opus

cd build/opus
export CFLAGS="-D_FORTIFY_SOURCE=0"
cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -DWITH_STACK_PROTECTOR=OFF 
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DWITH_OGG=ON  ../../src/opus

if you build libsndfile for example, it will lookfor ogg.dll and not libogg.dll
if you set LIBRARY libogg it will be OK

but it would be simpler to make like flac or opus, withiut a def file

@mipac, on WIndows no functions exported without DEF file. Better solution is remove LIBRARY statement from DEF.

mipac commented

ah didn't know that without LIBRARY it works
but how it works with flac or opus projects
they don't use .def
and linking with them works, with the good .dll.a pointing to the good dll

They use special compiler pragmas, good choice if you use it from start. But changing function export method for exisiting project may cause ABI breakage. The risk is too great.

mipac commented

ok 👍
I hope that issue could help someone building with mingw-w64 or msys2
thanx a lot