invalid use of incomplete type struct 或者是class的解决办法
生活随笔
收集整理的這篇文章主要介紹了
invalid use of incomplete type struct 或者是class的解决办法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在寫完代碼之后進行編譯時,提示"invalid use of incomplete type struct" 或者 "invalid use of incomplete type class" 的解決辦法:
1、對應的頭文件要包含,這個是必須的。
當時因為沒有包含頭文件,也匯報上的錯誤
2、編譯器不知道所用的是struct 還是class,所以需要引用該struct 或 class的頭文件,記住:只要引用了struct 或 class,就需要包含對應的頭文件
一般就是這2種情況,其他的情況暫未遇到,如果有遇到的請指教。zgaoq@163.com
總結
以上是生活随笔為你收集整理的invalid use of incomplete type struct 或者是class的解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: STAR原则及使用
- 下一篇: SwitchHost使用