I have installed "libsdl1.2-dev" and "libvlc" (with sudo apt-get install blah) in Raspbian on my Raspberry Pi, I'm using gcc to compile the example project from https://wiki.videolan.org/LibVLC_SampleCode_SDL/
This is my compile command:
gcc -fpermissive test.cpp -lvlc -lsdl1.2-dev -o test
It seems to compile (after I added -fpermissive and manually placed the vlc headers in usr/include/vlc) the error seems to happen during the linking phase, I get these 2 errors;
/usr/bin/ld: cannot find -lvlc
/usr/bin/ld: cannot find -lsdl1.2-dev
I'm a bit new to Linux and I can't work out why it can't find them. I'm also unsure where it installs them by default, there seem to be a few different places they could be.
Use pkg-config to get the needed compile and link flags.
pkg-config --cflags sdl libvlcwill print the needed compilation flags, andpkg-config --libs sdl libvlcthe needed link flags. You can use the$()feature of the shell to embed the output of pkg-config directly into your compile command. Also, useg++to compile and link C++ code.gccis for C code.The package names
sdlandlibvlccorrespond to*.pcfiles that are installed in/usr/lib/pkgconfig. If no such files exist, then that means you forgot to install the-devversions of the sdl and vlc libraries. So check if there's alibvlc-devpackage you need to install. Use this:See if there's a dev package for libvlc that you need.