Page 1 of 1

Needing Guide to Using LibVLC

Posted: 29 Feb 2012 22:40
by jrlanglois
Hello LibVLC developers,

And so after running through documentation and so forth, I've decided to start a VLC based, C++ project with Visual Studio 2010...

I've been here http://wiki.videolan.org/GenerateLibFromDll and generated the library successfully. So far so good!

But it seems there is missing information as to how I should actually be using the library in my project. So what if I link against the newly generated libvlc.lib situated in the VideoLAN\VLC folder?

I've added the following folder to my project's Additional Include Directories: "C:\Program Files (x86)\VideoLAN\VLC\sdk\include\vlc".
And now, I've "#include "vlc.h""... and am getting errors!

Is it possible for someone to lead me in the read direction for setting this stuff up? It's currently not apparent as to how I'm supposed to make use of LibVLC at all... :?

Re: Needing Guide to Using LibVLC

Posted: 01 Mar 2012 06:19
by captainst
Suppose that all your vlc header is inside a folder "C:\projects\VLC", copy the vlc.h to the upper level folder, i.e: "C:\projects", then in your project include that vlc.h.

You may paste the errors you get if you still experience problems.

Re: Needing Guide to Using LibVLC

Posted: 01 Mar 2012 15:12
by jrlanglois
Indeed I am still encountering an issue:

Code: Select all

[...]Cannot open include file: 'vlc/libvlc_structures.h': No such file or directory [...]
And so the issue is the fact that vlc.h is including the files as such:

Code: Select all

#include <vlc/libvlc_structures.h>
But, so far as I see it, vlc.h should be including the files with double-quotes instead of those brackets.

The same seems to apply to all the other files for LibVLC from the looks of it... am I expected to have copied the include folder to my Visual Studio Includes folder? (ie: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\)

Re: Needing Guide to Using LibVLC

Posted: 01 Mar 2012 15:21
by jrlanglois
...To oddly answer my own question: yes.

But now I'm encountering an unresolved external symbol when I simply tried to do "libvlc_new()" to the instance of a "libvlc_instance_t*".

Re: Needing Guide to Using LibVLC

Posted: 01 Mar 2012 17:25
by jrlanglois
Oh, and the unresolved external symbol still applies when doing the following in the same file that I'm using the libvlc_new() function:

Code: Select all

extern "C" { LIBVLC_API libvlc_instance_t* libvlc_new (int argc, const char* const* argv); }

Re: Needing Guide to Using LibVLC

Posted: 01 Mar 2012 17:36
by mangokm40
I get unresolved external symbols if I don't add "libvlc.lib" to the "Additional Dependencies" of the project.

Re: Needing Guide to Using LibVLC

Posted: 01 Mar 2012 17:50
by jrlanglois
But I am already linking against it there. :? And yes, the file exists (otherwise I'd get another, different, error), and yes, I have the correct path to it setup in my Additional Library Directories (otherwise I'd get another, different, error).

Re: Needing Guide to Using LibVLC

Posted: 13 Mar 2012 05:14
by KellenSunderland
Try the declaration like this:

//LIBVLC_API libvlc_instance_t * libvlc_new( int argc , const char *const *argv );
typedef libvlc_instance_t* (LIBVLC_API * _libvlc_new)( int argc , const char *const *argv );
_libvlc_new libvlc_new;

Re: Needing Guide to Using LibVLC

Posted: 13 Mar 2012 08:37
by RSATom
read this:
http://code.google.com/p/vc-axnp-vlc/so ... README.txt

it's slightly modified readme from VLC Web Plugins, which can be compiled by Visual Studio, and uses VLC only via libvlc.

Re: Needing Guide to Using LibVLC

Posted: 13 Mar 2012 08:41
by RSATom
and one more, you no need in http://wiki.videolan.org/GenerateLibFromDll anymore, since you can use:
1. libvlc.lib from official distribution (but it's buggy)
or
2. http://code.google.com/p/vc-libvlc/