0

I am trying to compile a simple code of libvlc found here libvlc tuto in a C project using gtk+2 on ubuntu

but I have an error message like this In function main: /home/bilel/esprit-2015-3b1-geekinnovators-svn/pp/src/main.c:65: undefined reference to 'libvlc_new'.

August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
Bine13
  • 1

1 Answers1

0

You need to link with libvlc. Append -lvlc to the compilation command.

Example:

cc -Wall test.c -lvlc

Also, the example should include the POSIX header file unistd.h which contains the declaration of the function sleep.

August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
  • The file where the vlc code is compiled and i have the executable now but i want to link it to the project when i add vlc.c (where the code is ) to the makefile.am i have the same errors .. i want to to set the two executables together .. – Bine13 Dec 01 '15 at 19:48
  • @Bine13 add `-lvlc` to *AM_LDFLAGS* in Makefile.am. – August Karlstrom Dec 01 '15 at 19:53
  • ` ## Process this file with automake to produce Makefile.in ` INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ @PACKAGE_CFLAGS@ bin_PROGRAMS = projet-c projet_c_SOURCES = \ main.c \ support.c support.h \ interface.c interface.h \ callbacks.c callbacks.h \ windows.c windows.h \ Authentification.c Authentification.h \ Alertes.c Alertes.h \ camera.c camera.h \ hello-world.c hello-world.h \ ajoutagent.c Agents.h projet_c_LDADD = @PACKAGE_LIBS@ $(INTLLIBS) – Bine13 Dec 01 '15 at 20:05