Hi all...
First, excuse me for bad english...
I'm new in C programming language, and I'm trying to run VLC from C code, using the libvlc.dll library. I found a tutorial at
http://wiki.videolan.org/LibVLC_Tutorial_086c
and I followed all the steps, using Dev-cpp as editor, but I couldn't compile the project.
These are the steps I followed:
1) Create a new project of type win32 Console
2) Create a new file: main.c, with the following content:
Code:
#include <stdio.h>
#include <windows.h>
#include <vlc/libvlc.h>
static void quit_on_exception (libvlc_exception_t *excp) {
if (libvlc_exception_raised (excp)) {
fprintf(stderr, "error: %s\n", libvlc_exception_get_message(excp));
exit(-1);
}
}
int main(int argc, char **argv) {
libvlc_exception_t excp;
libvlc_instance_t *inst;
int item;
char *myarg0 = "-I"; char *myarg1 = "dummy";
char *myarg2 = "--plugin-path=c:\\Programmi\\VideoLAN\\VLC\\plugins";
char *myargs[4] = {myarg0, myarg1, myarg2, NULL};
char *filename = "c:\\Pippo.flv";
libvlc_exception_init (&excp);
inst = libvlc_new (3, myargs, &excp);
quit_on_exception (&excp);
item = libvlc_playlist_add (inst, filename, NULL, &excp);
quit_on_exception (&excp);
libvlc_playlist_play (inst, item, 0, NULL, &excp);
quit_on_exception (&excp);
Sleep (10000);
libvlc_destroy (inst);
return 0;
}
3) I installed the VLC software, version 0.8.6c
http://download.videolan.org/pub/vid...8.6c-win32.exe
4) Copy the file libvlc.dll into the System32 directory, so it will be included in my system path
5) I downloaded the vlc software, (to compile)-version,
link:
http://download.videolan.org/pub/vid...8.6c-win32.zip
and copied the include/vlc folder in the Dev-cpp include folder, so the line #include <vlc/libvlc.h> now is correct.
6) I've created a makefile addons, where i put the following lines:
Code:
VLC_INST = "C:\Programmi\VideoLAN\VLC\"
VLC_SRC = "C:\Programmi\VideoLAN\vlc-0.8.6c\"
main: main.c
VLC_INST = "C:\Programmi\VideoLAN\VLC\"
VLC_SRC = "C:\Programmi\VideoLAN\vlc-0.8.6c\"
main: main.c
$(CC) -o main main.c -I$(VLC_SRC)/include -L$(VLC_INST) -llibvlc
Finish...but when I try to compile I get error on the last line of the make file addon:
Code:
$(CC) -o main main.c -I$(VLC_SRC)/include -L$(VLC_INST) -llibvlc
with the following error:
Code:
*** multiple target patterns. Stop
Where I'm wrong??
Anyone can help me??