Duplicate symbols with var defined in header & multiple inclusion protection

前端 未结 1 1887
梦谈多话
梦谈多话 2021-01-24 05:01

I have this header file (called ft_opp.h), that I\'m trying to #include in two different .c files:

#ifndef __FT_OPP_H__
# define __FT_OPP_H__
t_opp gl_opptab[] =         


        
相关标签:
1条回答
  • 2021-01-24 05:09

    extern t_opp* gl_opptab is not the same as the array of structs defined in the header. Try extern t_opp gl_opptab[]; in the other .c file. Of course the other .c file will need to know what a t_opp is, so there's at least one more header that'll need inclusion in the other .c file.

    0 讨论(0)
提交回复
热议问题