Linking Ogg Vorbis in Dev-C++

Started by
5 comments, last by Ranger_One 19 years, 6 months ago
I'm trying to get my ogg vorbis code to compile in Dev-C++, but I am having lilnking troubles. I downloaded the OggVorbis-win32sdk-1.0.1 off of the official homepage. Everything compiles fine, I'm just having linking issues. If I link with the non-static libs (vorbisfile.lib, vorbis.lib, ogg.lib), it just crashes when I try to run it. I've heard from several people to use the static libs (vorbisfile_static.lib, vorbis_static.lib, ogg_static.lib), but if I try to use them, I get all kinds of linker troubles. First off, I get lots of warnings about ".drectve `%.*s' unrecognized". More importantly, I get lots of errors like:

[Linker error] undefined reference to `_alldiv'
[Linker error] undefined reference to `_allmul'
[Linker error] undefined reference to `_alloca_probe'
[Linker error] undefined reference to `_allshr'
[Linker error] undefined reference to `_chkstk'
Does anyone know what I'm doing wrong? It seems like I must not be linking a library that I need, but I don't know which to add. I'd appreciate any help you could give me. Thanks.
Advertisement
I don't really know for sure, but maybe those static libraries were compiled with a different compiler/linker and that is what is causing problems? Could this be? I have heard of different compilers not liking eachother's code.
Libraries for GCC should look like: libname.a
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
Quote:Original post by smart_idiot
Libraries for GCC should look like: libname.a


You can use .lib but the easiest way to get Vorbis to work with Dev-C++ is to compile it from the configure script using MSYS.
I'm sorry I didn't reply to this sooner, I was out of town for a wedding. pkelly83, can you explain a little more? I'm unfamiliar with MSYS...
Quote:Original post by Mr Grinch
I'm sorry I didn't reply to this sooner, I was out of town for a wedding. pkelly83, can you explain a little more? I'm unfamiliar with MSYS...


MSYS can be found at mingw.org. It's a minimal bash shell that can be run on Windows to allow you to more easily work with gcc and other command line tools from the Linux world.

When you install MSYS, it will ask you if you would like to run the post-install process to sync with an existing MingW installation. You will want to do this. You have MingW installed in your Dev-C++ directory somewhere. The post-install will ask you for your mingw root directory. I've not used MSYS with Dev-C++, but I would guess that you should give the Dev-C++ root directory in this case.

MSYS is very useful when you use MingW for development.
A while back I built a dev-cpp project for Ogg/Vorbis simply called libOVA. Here is the project in .rar format with a pre-built library.

libOVA.rar

This topic is closed to new replies.

Advertisement