error C4430: missing type specifier - int assumed. Note: C++ does not...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ibjou
    New Member
    • Dec 2010
    • 1

    error C4430: missing type specifier - int assumed. Note: C++ does not...

    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int.

    That´s the answer I get when program is compiled. How can I fix that error?

    Here you have the .cpp file, so it´ll be easier for you to help!


    extern "C"
    {

    #include <libavcodec/avcodec.h>
    #include <libavformat/avformat.h>

    #include <libswscale/swscale.h>
    #include "libavcodec/opt.h"

    }

    #include <string>
    #include <SDL.h>
    #include <SDL_thread.h >

    _
    #undef main /* Prevents SDL from overriding main() */


    #include <stdio.h>
    #include <math.h>

    #define SDL_AUDIO_BUFFE R_SIZE 1024

    #define MAX_AUDIOQ_SIZE (5 * 16 * 1024)
    #define MAX_VIDEOQ_SIZE (5 * 256 * 1024)

    #define FF_ALLOC_EVENT (SDL_USEREVENT)
    #define FF_REFRESH_EVEN T (SDL_USEREVENT + 1)
    #define FF_QUIT_EVENT (SDL_USEREVENT + 2)

    #define VIDEO_PICTURE_Q UEUE_SIZE 1

    typedef struct PacketQueue {
    AVPacketList *first_pkt, *last_pkt;
    int nb_packets;
    int size;
    SDL_mutex *mutex;
    SDL_cond *cond;
    } PacketQueue;


    typedef struct VideoPicture {
    SDL_Overlay *bmp;
    int width, height; /* source height & width */
    int allocated;
    } VideoPicture;

    typedef struct VideoState {

    AVFormatContext *pFormatCtx;
    int videoStream, audioStream;
    AVStream *audio_st;
    PacketQueue audioq;
    uint8_t audio_buf[(AVCODEC_MAX_AU DIO_FRAME_SIZE * 3) / 2];
    unsigned int audio_buf_size;
    unsigned int audio_buf_index ;
    AVPacket audio_pkt;
    uint8_t *audio_pkt_data ;
    int audio_pkt_size;
    AVStream *video_st;
    PacketQueue videoq;

    VideoPicture pictq[VIDEO_PICTURE_Q UEUE_SIZE];
    int pictq_size, pictq_rindex, pictq_windex;
    SDL_mutex *pictq_mutex;
    SDL_cond *pictq_cond;

    SDL_Thread *parse_tid;
    SDL_Thread *video_tid;

    char filename[1024];
    int quit;
    } VideoState;

    SDL_Surface *screen;

    /* Since we only have one decoding thread, the Big Struct
    can be global in case we need it. */
    VideoState *global_video_s tate;



    Any help is very appreciated!
    Thanks in advance.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Default-int comes from C where if you don't declare the return type of a function then int is assumed. C++ does not allow that assumption. Check your functions and function prototypes and be sure that they all have a declared return type.

    Comment

    Working...