Needing Guide to Using LibVLC

This forum is about all development around libVLC.
jrlanglois
Blank Cone
Blank Cone
Posts: 11
Joined: 28 Feb 2012 22:58
VLC version: Latest
Operating System: Windows 7 x64

Needing Guide to Using LibVLC

Postby jrlanglois » 29 Feb 2012 22:40

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... :?

captainst
Blank Cone
Blank Cone
Posts: 24
Joined: 01 Sep 2011 16:43

Re: Needing Guide to Using LibVLC

Postby captainst » 01 Mar 2012 06:19

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.

jrlanglois
Blank Cone
Blank Cone
Posts: 11
Joined: 28 Feb 2012 22:58
VLC version: Latest
Operating System: Windows 7 x64

Re: Needing Guide to Using LibVLC

Postby jrlanglois » 01 Mar 2012 15:12

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

jrlanglois
Blank Cone
Blank Cone
Posts: 11
Joined: 28 Feb 2012 22:58
VLC version: Latest
Operating System: Windows 7 x64

Re: Needing Guide to Using LibVLC

Postby jrlanglois » 01 Mar 2012 15:21

...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*".

jrlanglois
Blank Cone
Blank Cone
Posts: 11
Joined: 28 Feb 2012 22:58
VLC version: Latest
Operating System: Windows 7 x64

Re: Needing Guide to Using LibVLC

Postby jrlanglois » 01 Mar 2012 17:25

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); }

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: Needing Guide to Using LibVLC

Postby mangokm40 » 01 Mar 2012 17:36

I get unresolved external symbols if I don't add "libvlc.lib" to the "Additional Dependencies" of the project.

jrlanglois
Blank Cone
Blank Cone
Posts: 11
Joined: 28 Feb 2012 22:58
VLC version: Latest
Operating System: Windows 7 x64

Re: Needing Guide to Using LibVLC

Postby jrlanglois » 01 Mar 2012 17:50

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

KellenSunderland
New Cone
New Cone
Posts: 5
Joined: 13 Mar 2012 05:04

Re: Needing Guide to Using LibVLC

Postby KellenSunderland » 13 Mar 2012 05:14

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;

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: Needing Guide to Using LibVLC

Postby RSATom » 13 Mar 2012 08:37

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.

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: Needing Guide to Using LibVLC

Postby RSATom » 13 Mar 2012 08:41

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/


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests