I have a question with regards to using VLC with C++.
I've tried using vlccpp Helloworld project but there seems to be an error in the library.
Since vlc is a header-only file, I've already included the path to the header but I can't upload the screenshot.
I get the following C1083 error message when I try to run the Helloworld example.
May I know how to fix this?
Thank you.
Code: Select all
#include "vlcpp/vlc.hpp"
#include <thread>
#include <iostream>
int main(int ac, char** av)
{
if (ac < 2)
{
std::cerr << "usage: " << av[0] << " <file to play>" << std::endl;
return 1;
}
auto instance = VLC::Instance(0, nullptr);
auto media = VLC::Media(instance, av[1], VLC::Media::FromPath);
auto mp = VLC::MediaPlayer(media);
mp.play();
std::this_thread::sleep_for( std::chrono::seconds( 10 ) );
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0) <<<-------ERROR SEEMS TO BE HERE
mp.stopAsync();
#else
mp.stop();
#endif
}
Build started...
1>------ Build started: Project: vlcHelloWorld, Configuration: Debug Win32 ------
1>Source.cpp
1>C:\sdk\libvlcpp-master\vlcpp\common.hpp(31,10): fatal error C1083: Cannot open include file: 'vlc/vlc.h': No such file or directory
1>Done building project "vlcHelloWorld.vcxproj" -- FAILED.
1>
1>Project Performance Summary:
1> 237 ms C:\Users\user\source\repos\vlcHelloWorld\vlcHelloWorld\vlcHelloWorld.vcxproj 1 calls