0

The following program is the one I want to execute:

#include <iostream>
#include <vlc/vlc.h>

int main() {    
    // Initialize libVLC        
    libvlc_instance_t* vlcInstance = libvlc_new(0, nullptr);
    
    // Create a media player        
    libvlc_media_player_t* mediaPlayer = libvlc_media_player_new(vlcInstance);
    
    // Create a media from the video source        
    libvlc_media_t* media = libvlc_media_new_location(vlcInstance, "http://10.122.1.241");
    
    // Set the media to the media player        
    libvlc_media_player_set_media(mediaPlayer, media);
    
    // Play the media        
     libvlc_media_player_play(mediaPlayer);
    
    // Wait for the video to finish streaming        
    std::cout << "Streaming video..." << std::endl;
    
    std::cin.get();
    
    // Stop and release resources        
    libvlc_media_player_stop(mediaPlayer);
    
    libvlc_media_player_release(mediaPlayer);        
    libvlc_media_release(media);        
    libvlc_release(vlcInstance);
    
    return 0;
}

I get the following errors:

in function main:
undefined reference to 'libvlc_new'
undefined reference to 'libvlc_media_release'
undefined reference to 'libvlc_media_player_release'
undefined reference to 'libvlc_release'
undefined reference to 'libvlc_media_player_stop'

How can I clear all these errors?

I tried streaming a video from vlc to another window on rasperry pi.

Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
  • 1
    Does this answer your question? [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Richard Critten May 30 '23 at 09:16

0 Answers0