[vlc-devel] Help with linking to libvlc dll

Mark Mitchell markmitchell at cynmark.com
Thu Feb 21 01:38:36 CET 2008

Hello again -

Does anyone out there know how to make the connection between the libvlc dll
and my source program.  I looked on the libvlc tutorial and example pages
and cannot find this.  I am new to this and don't know how to proceed.  I
have made a small hello world test program that contains calls to some
libvlc functions.  It compiles fine but the link phase cannot resolve the
dll based functions.  No where on the website could I find how this is done.
I have included code and the progress output below.

Another question.  I have managed to build the vlc executable from source
and have installed it using the zip version of the installer (great thanks
to Fafael Carre).  Now I want to communicate with the running version of vlc
from my small hello world program (just to confirm I can do it) through the
libvlc.dll.  Is this even possible?  Is there a better or simpler way? I
gathered from the website that this was the way to do it.

How does my program (which was generated by cygwin ultimately which I
believe is linux based), even run in a windows environment and furthermore
talk to a windows program (dll?) in what environment do I invoke it when it
does build?

clearly I am new to this and am muddling my way through.

Oe last question -  Is there a way to search the mailing lists for keywords
or even see the threads.  I have not been able to find this.  Just a listing
of the archives which is not very useful (no subjects).

Any help would be a great help.

below is the code.



 Name        : hello.c
 Author      : mark
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style

#include <stdio.h>
#include <stdlib.h>
#include <vlc/libvlc.h>

int main(void) {
	/* to catch problems */
	static libvlc_exception_t ex;
    if (libvlc_exception_raised (&ex))
        fprintf (stderr, "Exception: %s\n",
                 libvlc_exception_get_message (&ex));

    libvlc_exception_clear (&ex);

	puts("Hello World!!!"); /* prints Hello World!!! */

**** Build of configuration Debug for project hello world 6 ****

make all
Building file: ../src/hello world 6.c
Invoking: Cygwin C Compiler
gcc -I"C:\cygwin\home\Mark_Mitchell\vlc-trunk\include" -O0 -g3 -Wall -c -fme
ssage-length=0 -MMD -MP -MF"src/hello world 6.d" -MT"src/hello\ world\
6.d" -o"src/hello world 6.o" "../src/hello world 6.c"
Finished building: ../src/hello world 6.c

Building target: helloworld6.exe
Invoking: Cygwin C Linker
gcc  -o"helloworld6.exe"  ./src/hello\ world\ 6.o
./src/hello world 6.o: In function `main':
/cygdrive/c/Documents and Settings/Mark Mitchell/workspace2/hello world
6/Debug/../src/hello world 6.c:18: undefined reference to
/cygdrive/c/Documents and Settings/Mark Mitchell/workspace2/hello world
6/Debug/../src/hello world 6.c:20: undefined reference to
/cygdrive/c/Documents and Settings/Mark Mitchell/workspace2/hello world
6/Debug/../src/hello world 6.c:25: undefined reference to
collect2: ld returned 1 exit status
make: *** [helloworld6.exe] Error 1

More information about the vlc-devel mailing list