Results 1 to 2 of 2

Thread: Linker Lib .a into My VLC project

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Linker Lib .a into My VLC project

    i want build my project use libvlc but i havent library binary .a so QT error
    undefined reference to `libvlc_exception_raised'



    Qt Code:
    1. #include <stdio.h>
    2. #include <stdlib.h>
    3. #include <vlc/vlc.h>
    4.  
    5. static void raise(libvlc_exception_t * ex)
    6. {
    7. if (libvlc_exception_raised (ex))
    8. {
    9. fprintf (stderr, "error: %s\n", libvlc_exception_get_message(ex));
    10. exit (-1);
    11. }
    12. }
    13. int main(int argc, char* argv[])
    14. {
    15. const char * const vlc_args[] = {
    16. "-I", "dummy", /* Don't use any interface */
    17. "--ignore-config", /* Don't use VLC's config */
    18. "--plugin-path=/set/your/path/to/libvlc/module/if/you/are/on/windows/or/macosx" };
    19. libvlc_exception_t ex;
    20. libvlc_instance_t * inst;
    21. libvlc_media_player_t *mp;
    22. libvlc_media_t *m;
    23.  
    24. libvlc_exception_init (&ex);
    25. /* init vlc modules, should be done only once */
    26. inst = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args, &ex);
    27. raise (&ex);
    28.  
    29. /* Create a new item */
    30. m = libvlc_media_new (inst, "http://mycool.movie.com/test.mov", &ex);
    31. raise (&ex);
    32.  
    33. /* XXX: demo art and meta information fetching */
    34.  
    35. /* Create a media player playing environement */
    36. mp = libvlc_media_player_new_from_media (m, &ex);
    37. raise (&ex);
    38.  
    39. /* No need to keep the media now */
    40. libvlc_media_release (m);
    41.  
    42. #if 0
    43. /* This is a non working code that show how to hooks into a window,
    44.   * if we have a window around */
    45. libvlc_drawable_t drawable = xdrawable;
    46. /* or on windows */
    47. libvlc_drawable_t drawable = hwnd;
    48.  
    49. libvlc_media_player_set_drawable (mp, drawable, &ex);
    50. raise (&ex);
    51. #endif
    52.  
    53. /* play the media_player */
    54. libvlc_media_player_play (mp, &ex);
    55. raise (&ex);
    56.  
    57. //sleep (10); /* Let it play a bit */
    58.  
    59. /* Stop playing */
    60. libvlc_media_player_stop (mp, &ex);
    61.  
    62. /* Free the media_player */
    63. libvlc_media_player_release (mp);
    64.  
    65. libvlc_release (inst);
    66. raise (&ex);
    67.  
    68. return 0;
    69. }
    To copy to clipboard, switch view to plain text mode 
    iF i add LIBS += -lvlc into .pro then

    f:/programfiles/qt/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lvlc
    collect2: ld returned 1 exit status

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: Linker Lib .a into My VLC project

    Have you downloaded and placed the vlc library into your library path?

Similar Threads

  1. Replies: 1
    Last Post: 3rd December 2009, 23:34
  2. Project generation on linux from QT Project
    By darpan in forum Qt Programming
    Replies: 6
    Last Post: 11th December 2006, 09:43
  3. Linker error
    By alfblt16 in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2006, 09:20
  4. Linker errors!!
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2006, 08:14
  5. Linker Error
    By ankurjain in forum Qt Programming
    Replies: 2
    Last Post: 5th April 2006, 05:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.