VS2012 LibRTMP include c into c++
VS2012 LibRTMP include c into c++
我在生成我的exe的调试文件夹中有Librtmp.dll。头文件和辅助代码文件在我的项目中可用,包括如下所示。
使用这个包括....我可以使用智能感知的librtmp
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
智能感知:类型为"RTMP *"的参数与类型为"RTMP *"的参数不兼容
这首先发生在这一点。然后再一次,对于后面的每个r变量
r = RTMP_Alloc();
有人建议使用typedef。
理解C语言中函数指针的类型
这导致…
typepedef (RTMP*)(RTMP* RTMP);
然而,Visual Studio只是嘲笑我…摇着它的头,想知道我是否知道自己在做什么。
智能感知:声明与其类同名的成员
任何线索或想法都会有用的。
谢谢。
更新-完整代码
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);
}
};
EPIC FACE PALM
最深的歉意我的类叫做RTMP
谢谢@vard
相关文章:
- Old C++ DLLs into C#
- std::move into static_pointer_cast:为什么static_pointer_cast没有右值引用重载?
- boost::spirit::qi::phrase_parser() into std::map error
- Memcpy uint32_t into char*
- std::vector<char> into std::vector<T> conversion c++
- Importing libssh into Qt
- "scoping into"类的头文件是否C++创建它的实例?
- protobuf-net into .proto 会产生枚举冲突
- C++ fread() into a std::string
- 第 13 "Jumping into C++" 章测验 3 的正确答案?
- std::bad_alloc when inserting into std::unordered_map?
- Taking into account
- C++ LogFont Embed Into XPS
- 文件系统项目"Member access into incomplete type"错误
- RTSP Stream into OpenCV
- MFC CView into CDockablePane
- push_back std::pair into std::vector error
- 这是解决 GCC "sorry, unimplemented: cannot expand ‘NEXT ...’ into a fixed-length argument list"错误的好方法吗?
- 使用C++的SQLite中的INSERT INTO命令不起作用
- Eclipse CDT "step into"不起作用