What does this error mean: “error: expected specifier-qualifier-list before 'type_name'”?

前端 未结 7 795
挽巷
挽巷 2020-12-05 06:09

I\'ve been working on the Cell processor and I\'m trying to create a struct that will hold an spe_context_ptr_t, which will be used within the thread to launch

7条回答
  •  北海茫月
    2020-12-05 06:48

    I had the same error message but the solution is different.

    The compiler parses the file from top to bottom.

    Make sure a struct is defined BEFORE using it into another:

    typedef struct
    {
        char name[50];
        wheel_t wheels[4]; //wrong, wheel_t is not defined yet
    } car_t;
    
    typedef struct
    {
        int weight;
    } wheel_t;
    

提交回复
热议问题