![]() |
| | #1 |
| Registered User Join Date: Sep 2008
Posts: 1
| Using VLC from C code 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;
}
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 Code: $(CC) -o main main.c -I$(VLC_SRC)/include -L$(VLC_INST) -llibvlc Code: *** multiple target patterns. Stop Anyone can help me?? Last edited by Morris83; 09-14-2008 at 07:53 AM. |
| Morris83 is offline | |
| | #2 |
| and the Hat of Ass Join Date: Dec 2007
Posts: 730
| You have two targets for main in the Makefile. Get rid of this: Code: main: main.c VLC_INST = "C:\Programmi\VideoLAN\VLC\" |
| rags_to_riches is offline | |
![]() |
| Tags |
| vlc libvlc windows dll |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Enforcing Machine Code Restrictions? | SMurf | Tech Board | 21 | 03-30-2009 07:34 AM |
| Obfuscated Code Contest: The Results | Stack Overflow | Contests Board | 29 | 02-18-2005 05:39 PM |
| Obfuscated Code Contest | Stack Overflow | Contests Board | 51 | 01-21-2005 04:17 PM |
| Interface Question | smog890 | C Programming | 11 | 06-03-2002 05:06 PM |
| Who will map the scan code (inserted by VKD_Force_keys) to virtual key code? | Unregistered | Windows Programming | 0 | 02-21-2002 06:05 PM |