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

Govind Kharbanda govind.kharbanda at sli-institute.ac.uk
Thu Jun 27 01:16:44 PDT 2002



Hi James,

Thanks for taking the trouble to reply in detail.  We'll try that and
let you know how we get on.  Things will get more interesting when we
try putting bits of it in hardware!

Incidentally, we did try again with GNU under Unix, and I think we
managed to include all the lib paths there, but had problems relating to
'libcurl'; we tried adding various flags to disable 'libcurl' but no
joy.

Cheers,
Gov

James Boer wrote:
> 
> 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.
> 


-- 
Govind S Kharbanda                Institute for System Level Integration
MSc Course Rep.                        Alba Campus, Livingston, EH54 7EG
http://www.sli-institute.ac.uk/~gk/                    Tel: 01506 469340

--- >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