C++ previous definition error

后端 未结 2 1043
伪装坚强ぢ
伪装坚强ぢ 2021-01-12 18:59

So, thanks to this website, I found the answer to my previous problem. I\'m adding a function to a class in a GNU automake project that uses a pointer to a doc

2条回答
  •  情书的邮戳
    2021-01-12 19:31

    You are missing include guardians. if you just include files they are just pasted you need to make sure when they are included multiple times that they other times the code isn't duplicated. so you use a construct like this.

     #ifndef _XXX_
     #define _XXX_
        /* your header here */
     #endif
    

提交回复
热议问题