Page 1 of 1

Compiling libVLC on Windows 7

Posted: 21 Dec 2016 13:42
by DrageFabeldyr
Hi everybody. I have two cameras and wanna see streaming from them both in my program. For this i need libVLC.
I've never worked with RSTP so i've tried this example to understand how it works.
It also requires these libraries to work but they are only for the release version.
So to write my own program i need library for debug version, so i have to compile it from the sources.

I've downloaded sources from here and tried to compile it using CMake but i have an error:

Code: Select all

CMake Error at cmake/FindLIBVLC.cmake:99 (MESSAGE): Could not find LibVLC Call Stack (most recent call first): config/Dependencies.cmake:59 (FIND_PACKAGE) CMakeLists.txt:50 (INCLUDE)
Instruction says:

Code: Select all

-DLIBVLC_LIBRARY="E:/vlc/win64/sdk/lib/libvlc.lib" ^ -DLIBVLCCORE_LIBRARY="E:/vlc/win64/sdk/lib/libvlccore.lib" ^ -DLIBVLC_INCLUDE_DIR="E:/vlc/win64/sdk/include"
but what have to be in these folders and where i can get it?

Re: Compiling libVLC on Windows 7

Posted: 22 Dec 2016 10:16
by DrageFabeldyr
ok, according to my understanding of what instruction mentioned above says and this answer solution is:
download VLC from here
it includes "sdk" folder
than put paths into cmake-gui flags

Code: Select all

LIBVLC_LIBRARY="D:/qtprojects/vlc-2.2.4/sdk/lib/libvlc.lib" LIBVLCCORE_LIBRARY="D:/qtprojects/vlc-2.2.4/sdk/lib/libvlccore.lib" LIBVLC_INCLUDE_DIR="D:/qtprojects/vlc-2.2.4/sdk/include"
D:/qtprojects/vlc-2.2.4 is where i extracted .7z
then configure -> configuring done -> generate -> generating done that's fine.

next steps are:
Open a cmd prompt (Click Run.. then enter cmd)
Go to your build folder using the cd command
Type mingw32-make
and it says:

Code: Select all

collect2.exe: error: ld returned 1 exit status src\core\CMakeFiles\Core.dir\build.make:702: recipe for target 'src/core/libVLCQtCore.dll' failed mingw32-make[2]: *** [src/core/libVLCQtCore.dll] Error 1 mingw32-make[2]: Leaving directory 'D:/qtprojects/vlcqt110result' CMakeFiles\Makefile2:115: recipe for target 'src/core/CMakeFiles/Core.dir/all' failed mingw32-make[1]: *** [src/core/CMakeFiles/Core.dir/all] Error 2 mingw32-make[1]: Leaving directory 'D:/qtprojects/vlcqt110result' Makefile:140: recipe for target 'all' failed mingw32-make: *** [all] Error 2
------------------------- update 1 -------------------------
i think the problem is than sdk from .../win64 but mingw32, ok
download VLC for win32 from here
than put paths into cmake-gui flags

Code: Select all

LIBVLC_LIBRARY="D:/qtprojects/vlc-2.2.4-32/sdk/lib/libvlc.lib" LIBVLCCORE_LIBRARY="D:/qtprojects/vlc-2.2.4-32/sdk/lib/libvlccore.lib" LIBVLC_INCLUDE_DIR="D:/qtprojects/vlc-2.2.4-32/sdk/include"
D:/qtprojects/vlc-2.2.4-32 is where i extracted .7z
then configure -> configuring done -> generate -> generating done that's fine.
Open a cmd prompt (Click Run.. then enter cmd)
Go to your build folder using the cd command
Type mingw32-make
it works about two minutes and it seems that everything is fine
Type mingw32-make install
and after few seconds it says:

Code: Select all

-- Up-to-date: C:/Program Files (x86)/VLC-Qt/include/VLCQtQml/QmlVideoPlayer.h CMake Warning (dev) at src/plugins/VLCQt/cmake_install.cmake:49: Syntax Warning in cmake code at column 128 Argument not separated from preceding token by whitespace. Call Stack (most recent call first): src/cmake_install.cmake:35 (include) cmake_install.cmake:664 (include) This warning is for project developers. Use -Wno-dev to suppress it. -- Installing: C:/Program Files (x86)/VLC-Qt/qml/VLCQt/libVLCQt.dll.a -- Installing: C:/Program Files (x86)/VLC-Qt/qml/VLCQt/VLCQt.dll -- Installing: C:/Program Files (x86)/VLC-Qt/qml/VLCQt/qmldir CMake Error at src/plugins/VLCQt/cmake_install.cmake:49 (EXECUTE_PROCESS): execute_process given unknown argument "Files". Call Stack (most recent call first): src/cmake_install.cmake:35 (include) cmake_install.cmake:664 (include) Makefile:95: recipe for target 'install' failed mingw32-make: *** [install] Error 1
------------------------- update 2 -------------------------
i have changed CMAKE_INSTALL_PREFIX from default C:\Program Files (x86)\VLC-Qt to C:\VLC
now mingw32-make install did everything well
will try to use it in my program

Re: Compiling libVLC on Windows 7

Posted: 23 Dec 2016 13:37
by DrageFabeldyr
Ok. I've done what i needed. Here i described my soluion if anybody else need it. Just don't want two write it twice.