在生成exe的调试文件夹中有Librtmp.dll。标题和辅助代码文件可在我的项目和包括如下所示。
用这个包括..。我可以在intellisense中使用图书。
extern "C" {
#include "libavcodec/avcodec.h"
#include "libavdevice/avdevice.h"
#include "libavfilter/avfilter.h"
#include "libavformat/avformat.h"
#include "libavutil/avutil.h"
#include "librtmp/rtmp.h"
}
下面是正在使用的代码示例。
RTMP *r;
char uri[]="rtmp://localhost:1935/live/desktop";
r = RTMP_Alloc();
RTMP_Init(r);
RTMP_SetupURL(r, (char*)uri);
RTMP_EnableWrite(r);
RTMP_Connect(r, NULL);
RTMP_ConnectStream(r,0);
VS2012
IntelliSense:类型"RTMP *“的参数与"RTMP *”类型的参数不兼容
这首先发生在这一点上。然后再一次,对于每个跟随r变量。
r = RTMP_Alloc();
有些人认为应该使用类型胡枝子。
Understanding typedefs for function pointers in C
这导致..。
(rtmp* rtmp);
然而,Visual只是嘲笑我..。摇头在想我是否知道自己在做什么。
IntelliSense:与类同名的成员的声明
任何线索或想法都是有用的。
谢谢。
更新-完整代码
extern "C" {
#include "libavcodec/avcodec.h"
#include "libavdevice/avdevice.h"
#include "libavfilter/avfilter.h"
#include "libavformat/avformat.h"
#include "libavutil/avutil.h"
}
#include "librtmp/rtmp.h"
class RTMP
{
RTMP()
{
}
~RTMP()
{
}
typedef (RTMP*)(RTMP* rtmp);
void RTMP::Run()
{
//Code
//Init RTMP code
RTMP *r;
char uri[]="rtmp://localhost:1935/live/desktop";
r = RTMP_Alloc();
RTMP_Init(r);
RTMP_SetupURL(r, (char*)uri);
RTMP_EnableWrite(r);
RTMP_Connect(r, NULL);
RTMP_ConnectStream(r,0);
}
};
发布于 2014-05-20 09:35:13
史诗脸棕榈
最深切的歉意
我的课叫RTMP。
谢谢你@vard
https://stackoverflow.com/questions/23755643
复制相似问题