🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

vorbisfile and visual c++

Started by
5 comments, last by DV8D 21 years, 6 months ago
I have been trying to compile the vorbisfile example from the sdk but i cant get it to work. I´ve made a new console app and just added the vorbisfile example and linked to vorbisfile.lib. It compiles ok with a few warning but when i run the app i get an exception in kernel32. It seems to happed in the ov_open(). Anyone got any useful tips to share?
Advertisement
Try linking the non-static libraries. I can''t remember which, but I had issues while using either the non-static or the static libraries. I regularly compile programs using VorbisFile in MSVC (the Windows port of my engine), so I know that it works. I''m too lazy to boot Windows to check how I setup the project, but I will later if I have to.

Thanks for the tip but it wasn´t that I tried to link to vorbisfile_static.lib instead but then it didn´t compile. I have something figure out thou, the exception happends in ov_open when the program sends stdin as param for first argument. When I change this too NULL the program run. When I instead try too load my own file like

  OggVorbis_File vf;File *boom = fopen("boom.ogg", "r");ov_open(boom, &vf, NULL, 0)   

then theres an exception again. I am clueless. Any ideas?
I think i had the same problem. What I had to do was use the static vorbis libs and ignore the default library "libc.lib" (which means it uses the multithreaded run time library msvcrt.lib i guess, i had to do this even though my app was not multithreaded).

I eventually ended up not using ogg vorbis very much b/c many of my programs had problems with it linking to msvcrt.lib instead of libc.lib. If anyone knows a way around this please tell me.


Digital Radiation
The stream you pass the ov_open must be opened in binary mode. That means you have to set stdin to binary (with setmode or something? I forget), and insure there''s a "b" in every fopen you use for it. This only really affects Windows, since other OS''s don''t differentiate between binary/text mode, but it doesn''t hurt to always put the "b" in there.

Thanks a lot guys :D I changed the linking and opened my file as binary and it worked.
err, i''m bumping this thread as i have the same problem and i don''t understand what AA_970 did to fix it. i''m using the static libraries, and i put libc.lib in the ignore library list, but it still doesn''t work.

This topic is closed to new replies.

Advertisement