[vorbis] Getting started with vorbisfile_example.c (MS VC 6)

James Boer james.boer at gte.net
Wed Jun 26 11:25:14 PDT 2002



There is no need to use the makefiles.  You should be able to get the
vorbisfile_example.c up and running with no problems using a Visual Studio
Workspace and Project you create yourself.

It sounds as though you have not yet set the proper include and lib paths so
that VC knows how to find the proper Vorbis headers and libraries.  Here's
the basic steps you need to follow from start to finish:

1)  Place the Vorbis SDK into a semi-permanent place on your hard drive,
where you can point your compiler to it.  I've put mine at c:\vorbis_sdk.
I'll use this directly in my examples that follow - you can use whatever
directory you want.  By SDK, I mean that you should have a directory tree
that includes the \examples, \include, \lib, and \redist folders.

2)  Next, you must tell VC to look for Vorbis include and library files when
compiling a project.  Go to Tool | Options and select the Directories tabs.
Point include paths to c:\vorbis_sdk\include and lib path to
c:\vorbis_sdk\lib.

3)  Create a new VC project and workspace - a Win32 console application
should do fine.  It doesn't matter where you put it.  In fact, it's probably
best to put it in a different place than the Vorbis SDK.  Call it something
like VorbisTest.  Tell it to create an empty project.

4)  Copy vorbisfile_example.c over to your new project directory, and add it
to your project.  If you've set up the include paths correctly, you should
be able to compile, but you still shouldn't be able to link yet.

5)  Now you must tell your program to link with the Vorbis libraries.

Here are the library types and what they are used for:

ogg.lib 		Base library used for ogg projects.
vorbis.lib		Low-level Vorbis decoding library.
vorbisenc.lib	Low-level Vorbis encoding library.
vorbisfile.lib	High-level Vorbis file reading library.

If you want to use the static version of the library instead of the dlls,
append _static to the name.
The debug versions have a _d appended to the file name.

Select Project | Settings, and look for the list of library names labelled
"object/library modules".  Add the appropriate static libraries, which in
this case are ogg_d.lib, vorbis_d.lib, and vorbisfile_d.lib.  Note that the
debug version of the project is selected by default.  In the "Settings For"
dropdown list (in the upper left corner of the dialog), Select Win32
Release.  Now you can add ogg.lib, vorbis.lib, and vorbisfile.lib to the
release version of your project.

If you wish to compile with the static libraries, you will need to perform
one extra step.  Your project should be designated to use the multithreaded
C-runtime dlls instead of the single-threaded static libraries, which are
chosen by default.  Go to Project | Settings, and select the C++ tab.
Select "Code Generation" from the Category list.  In the Run-time Library
drop list, choose "Multhreaded Debug DLL" for the debug project, and
"Multithreaded DLL" for release (don't forget to do both).

6) Now copy the vorbis dlls to same directory your project resides at, or
make sure it is somewhere in your Windows search path.  This is not
necessary if you compiled with the static libraries, of course.

6) Compile, link, and enjoy.

<p><p><p>>
>
> Hello
>
> Hope you don't mind another newbie's question.
>
> Further to GIE's email about problems compiling decoder_example.c example
> (MS VC 7) using debug static ogg/vorbis libs, we'd appreciate any help
> getting the example files to compile on MS VC 6.
>
> The zip files we have downloaded are:
>
> libao-0.8.2.zip
> libogg-1.0rc3.zip
> libvorbis-1.0rc3.zip
> vorbis-sdk-1.0rc3.zip
> vorbis-tools-1.0rc3.zip
>
> from http://www.vorbis.com/download_win.psp
>
> Are these the right files?
>
> We extracted the sdk ZIP file to give the Win32 SDK and have tried to
> compile vorbis-sdk-1.0rc3/examples/vorbis/vorbisfile_example.c  However,
> this requires the codec.h and vorbisfile.h headers and the corresponding
> object files.  We have spent a couple of days trying to get the example to
> work (and also studying the makefiles) but no success.
>
> We are also new to MS VC6 (having only used GNU on Unix before)
> and so also
> don't know if we're creating the project correctly.  If anybody could give
> us step by step instructions from firing up Microsoft Visual C++
> right up to
> compiling decoder_example.c, we'd really appreciate it as we're
> very new to
> this compiler and source code.
>
> Cheers
> Govind
>
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
>

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list