Sign in to follow this  

how exactly to setup Ogg?

This topic is 3480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I want to use the Ogg format in my game in order to reduce download size. Thus I need to integrate the Ogg/Vorbis library (or just Ogg?) into my current project, which is being made in VC++2005 Express. I went over to the Ogg Vorbis site. I could not find anything listed as an "SDK." Instead I only found libogg-1.1.3.zip and libvorbis-1.2.0.zip. I downloaded these, but they don't seem to contain what I'm looking for. Neither folder has any .lib's in it. Am I supposed to actually make my own .lib files using the C files in these folders? Or is there a "real" Ogg Vorbis SDK out there that I haven't managed to find yet? Forgive me - I've never actually used a third-party library before (besides DirectX.) I'm just a little bewildered about what I'm supposed to do next. Thanks, Greg

Share this post


Link to post
Share on other sites
All I really need to do is get raw data out of .ogg files, which means all I really need is the ogg_read() function, or whatever it's called.

Is it OK for me to just rip the code out and put it in my own source, even though my project is commercial?

Share this post


Link to post
Share on other sites
There are project and batch files under the win32 folder, use them to build your libs.

I believe the Ogg license allows you to statically link for commercial/closed source projects, however its still better to compile the library and link to it rather than dumping the source files into your project.

Share this post


Link to post
Share on other sites
Thanks for pointing that out - I found them!

However, I'm not exactly sure what's supposed to happen now (I'm pretty uncomfortable with .bat files - this thread should probably have been in For Beginners.)

Here's build_ogg_static.bat:


@echo off
echo ---+++--- Building Ogg (Static) ---+++---

if .%SRCROOT%==. set SRCROOT=i:\xiph

set OLDPATH=%PATH%
set OLDINCLUDE=%INCLUDE%
set OLDLIB=%LIB%

call "c:\program files\microsoft visual studio\vc98\bin\vcvars32.bat"
echo Setting include paths for Ogg
set INCLUDE=%INCLUDE%;%SRCROOT%\ogg\include
echo Compiling...
msdev ogg_static.dsp /useenv /make "ogg_static - Win32 Release" /rebuild

set PATH=%OLDPATH%
set INCLUDE=%OLDINCLUDE%
set LIB=%OLDLIB%



I double-clicked the file and nothing happened.

I checked the 'call' directory and there is no "vc98" folder in the microsoft visual studio directory. Do I need to change the .bat instructions because I am using VC++2005 Express?

It seems to me like this .bat is written to be used with an older version of Visual Studio. But, since I don't really understand what this .bat file is doing (I've never used Visual Studio from the command line before) I'm not sure what changes to make.

Share this post


Link to post
Share on other sites
I tried running build_ogg_static.bat from the command line - here's the output I got:

Quote:

C:\Documents and Settings\Student\Desktop\libogg-1.1\win32>build_ogg_static
---+++--- Building Ogg (Static) ---+++---
The system cannot find the path specified.
Setting include paths for Ogg
Compiling...
'msdev' is not recognized as an internal or external command,
operable program or batch file.


I heard someone say that the folder libvorbis-1.0.1 on the xiph site contained already-compiled source. However, this folder does not have any libs or dlls in it. So that didn't really get me any farther.

Share this post


Link to post
Share on other sites
Quote:
Original post by synth_cat
Oh, sorry Kwizatz - I didn't realize you had just posted. - I'll come back once I've had a look at that .dsw file.


No problem, I noticed the batch files are quite outdated (as is the VS project) after I made my initial post, sorry about that, I usually compile these things with MSYS, so I had not done with VS2005/VS2008.

Share this post


Link to post
Share on other sites
I may be being slightly naive here, but can you not just use SDL_Mixer to accomodate OGG into your game...then download a conversion tool e.g. Audacity to convert your mp3 to OGG?

Share this post


Link to post
Share on other sites
Sorry to bring this up again, but does anyone know where I can find ogg.dll, vorbisfile.dll, etc.? I can't find them on the oggvorbis site - just source code. I can come across the oggvorbis-win32sdk.zip file on other places online, but I'm not sure which places are "safe."

Share this post


Link to post
Share on other sites
Quote:
Original post by synth_cat
Sorry to bring this up again, but does anyone know where I can find ogg.dll, vorbisfile.dll, etc.? I can't find them on the oggvorbis site - just source code. I can come across the oggvorbis-win32sdk.zip file on other places online, but I'm not sure which places are "safe."


They don't supply binaries, have you tried compiling it yourself?
If you really just want a ready made one, the dll's are included in the project file downloads of this tutorial on devmaster.net

Share this post


Link to post
Share on other sites
Quote:

They don't supply binaries, have you tried compiling it yourself?
If you really just want a ready made one, the dll's are included in the project file downloads of this tutorial on devmaster.net


I tried going to the oggvorbis site and downloading their files. I end up with a bunch of "create_ogg_dll.bat" type files which all fail when I try to run them as I mentioned earlier in this thread.

I did check the download links on the DevMaster tutorial and the Dev-C++ one does indeed contain ogg.dll, vorbisfile.dll, and the others. Am I free to use these for commercial purposes, or am I legally required to build them myself?

And does anyone know how to build the dlls from the files from the oggvorbis site? I want to be able to switch between static vs. dynamic if necessary, and the files that come with the DevMaster tutorial files seem to be just the dynamic versions.

Share this post


Link to post
Share on other sites
I tried building libvorbis on my own by going into the xiph files into libvorbis-1.2.0\win32\VS2005\libvorbis and building the project file in there.

I get these errors, even if I change global IDE settings to go to the "lib" directory within the libvorbis-1.2.0


Linking...
Creating library C:\Documents and Settings\Student\Desktop\libvorbis-1.2.0\win32\VS2005\libvorbis\Debug/libvorbis.lib and object C:\Documents and Settings\Student\Desktop\libvorbis-1.2.0\win32\VS2005\libvorbis\Debug/libvorbis.exp
analysis.obj : error LNK2019: unresolved external symbol _oggpack_bytes referenced in function _vorbis_analysis
bitrate.obj : error LNK2001: unresolved external symbol _oggpack_bytes
info.obj : error LNK2001: unresolved external symbol _oggpack_bytes
analysis.obj : error LNK2019: unresolved external symbol _oggpack_get_buffer referenced in function _vorbis_analysis
bitrate.obj : error LNK2001: unresolved external symbol _oggpack_get_buffer
analysis.obj : error LNK2019: unresolved external symbol _oggpack_reset referenced in function _vorbis_analysis
info.obj : error LNK2001: unresolved external symbol _oggpack_reset
mapping0.obj : error LNK2001: unresolved external symbol _oggpack_write
res0.obj : error LNK2001: unresolved external symbol _oggpack_write
bitrate.obj : error LNK2019: unresolved external symbol _oggpack_write referenced in function _vorbis_bitrate_addblock
codebook.obj : error LNK2001: unresolved external symbol _oggpack_write
floor1.obj : error LNK2001: unresolved external symbol _oggpack_write
info.obj : error LNK2001: unresolved external symbol _oggpack_write
bitrate.obj : error LNK2019: unresolved external symbol _oggpack_writetrunc referenced in function _vorbis_bitrate_addblock
block.obj : error LNK2019: unresolved external symbol _oggpack_writeinit referenced in function _vorbis_block_init
info.obj : error LNK2001: unresolved external symbol _oggpack_writeinit
block.obj : error LNK2019: unresolved external symbol _oggpack_writeclear referenced in function _vorbis_block_clear
info.obj : error LNK2001: unresolved external symbol _oggpack_writeclear
mapping0.obj : error LNK2001: unresolved external symbol _oggpack_read
res0.obj : error LNK2001: unresolved external symbol _oggpack_read
synthesis.obj : error LNK2001: unresolved external symbol _oggpack_read
codebook.obj : error LNK2019: unresolved external symbol _oggpack_read referenced in function _vorbis_staticbook_unpack
floor0.obj : error LNK2001: unresolved external symbol _oggpack_read
floor1.obj : error LNK2001: unresolved external symbol _oggpack_read
info.obj : error LNK2001: unresolved external symbol _oggpack_read
codebook.obj : error LNK2019: unresolved external symbol _oggpack_adv referenced in function _decode_packed_entry_number
codebook.obj : error LNK2019: unresolved external symbol _oggpack_look referenced in function _decode_packed_entry_number
info.obj : error LNK2019: unresolved external symbol _oggpack_readinit referenced in function _vorbis_synthesis_idheader
synthesis.obj : error LNK2001: unresolved external symbol _oggpack_readinit

Share this post


Link to post
Share on other sites
OK, I figured it out.

You have to build the ogg libs first (use the .dsw that comes with the ogg file off xiph.) Then you do the same with the vorbis libs, except in order to build them you have to link to the ogg libs you just created.

Share this post


Link to post
Share on other sites
Sorry to keep on bringing this up, but I have another problem.

When I build in Debug I'm getting the warning
Quote:

LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library


I get no such warning when I build in Release mode.

- I am using Visual C++ 2005 Express
- In Debug Mode my Runtime Library setting is Multi-threaded Debug DLL (/MDd)
- In Release my Runtime Library setting is Multi-threaded (/MT)
- In Debug Mode I link to ogg_static.lib vorbis_static.lib vorbisfile_static.lib
- In Release I link to ogg_static.lib vorbis_static.lib vorbisfile_static.lib

Does anyone know if the LNK4098 should be worried about in this case? If so, how can I fix it, seeing as the problem seems to have to do with the pre-built libs I am linking to?

Share this post


Link to post
Share on other sites

This topic is 3480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this