0

I have Librtmp.dll in the debug folder where my exe is generated. The header and auxillary code files are available in my project and included as shown below.

Using this include.... i can use librtmp with 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"
}

Here is the code example that is being used.

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: argument of type "RTMP *" is incompatible with parameter of type "RTMP *"

This occurs at this point first. Then once again, for each follow r variable.

r = RTMP_Alloc();

Some reading has suggested using a typedef.

Understanding typedefs for function pointers in C

This lead to...

typedef (RTMP*)(RTMP* rtmp);

However, Visual Studio just laughed at me... shaking it's head wondering if i even knew what i was doing.

IntelliSense: declaration of a member with the same name as its class

Any clues or ideas would be useful.

Thank you.

UPDATE - COMPLETE CODE

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);
    }
};
Community
  • 1
  • 1
WebSight
  • 640
  • 2
  • 12
  • 27
  • First suggestion don't always trust intellisense optput they are just indication it happens with me lots of time that there are some intellisense error warnings but when I start build it gets succeeded. Also I can see that header for RTMP you included are given C linkage so it's a C struct and code you are doing is C++ so struct with C linkage is different than a struct in C++ . That could be the error but it would be good if you can give more on the code. – user3494614 May 20 '14 at 09:27
  • @vard Yup. Tried that first. :) – WebSight May 20 '14 at 09:27
  • @user3494614 full code added. – WebSight May 20 '14 at 09:29
  • You have a name conflict here, obviously RTMP is a name for some data struct provided by your library, and your class has the same name. Rename your class to solve this issue. `RTMP *r` this code inside your class declare `r` as pointer to your class, not library struct. – vard May 20 '14 at 09:30

1 Answers1

0

EPIC FACE PALM

Deepest Apologies

My class is called RTMP

Thank you @vard

WebSight
  • 640
  • 2
  • 12
  • 27