C ++在哪里包含文件,所以我可以为<libvlc>做#include

时间:2017-07-09 23:35:47

标签: c++ cocos2d-x vlc libvlc

这可能看起来像一个愚蠢的问题,但现在已经过了几天,我无法弄清楚,我在哪里可以包含libvlc文件?

我有这个示例代码

#include <stdio.h>
#include <stdlib.h>
#include <vlc/vlc.h>

int main(int argc, char* argv[])
 {
 libvlc_instance_t * inst;
 libvlc_media_player_t *mp;
 libvlc_media_t *m;

 /* Load the VLC engine */
 inst = libvlc_new (0, NULL);

 /* Create a new item */
 m = libvlc_media_new_location (inst, "http://mycool.movie.com/test.mov");
 //m = libvlc_media_new_path (inst, "/path/to/test.mov");

 /* Create a media player playing environement */
 mp = libvlc_media_player_new_from_media (m);

 /* No need to keep the media now */
 libvlc_media_release (m);

#if 0
 /* This is a non working code that show how to hooks into a window,
  * if we have a window around */
  libvlc_media_player_set_xwindow (mp, xid);
 /* or on windows */
  libvlc_media_player_set_hwnd (mp, hwnd);
 /* or on mac os */
   libvlc_media_player_set_nsobject (mp, view);
#endif

 /* play the media_player */
 libvlc_media_player_play (mp);

 sleep (10); /* Let it play a bit */

 /* Stop playing */
 libvlc_media_player_stop (mp);

 /* Free the media_player */
 libvlc_media_player_release (mp);

 libvlc_release (inst);

 return 0;
 }

它已经够糟糕了我现在只能理解一半的代码,但我无法从第一步获得,这是

#include <vlc/vlc.h>

无论我在哪里尝试放置文件(我认为它在目录中就像常规&#34; foo.h&#34;头文件但它似乎不起作用。我知道使用是不同的那&#34;这&#34;,&lt;&gt;用于标准模板库......我认为......到目前为止唯一有效的解决方案是

#include <C:\Users\patrik\Desktop\vlc-master\include\vlc\vlc.h>

这并不奇怪它是一条完整的路径,但是然后头文件链接了很多其他文件,编译器无法找到它们,所以它显然不是真正的解决方案。

提前致谢!

ps:如果它有帮助,我试图在Cocos2d-x中的精灵上渲染视频

0 个答案:

没有答案