報錯如下:
首先在報錯語句沒有語法錯誤,但是就是報錯,爲什麼這樣呢?以下是一種原因
是因爲頭文件的循環包含。
patientinterface.h文件
PatientInterfaceInformation *uiinformation;報錯,但是這裏是沒有語法錯誤。
原因:PatientInterfaceInformation類是在其他地方定義的,因此需要包含這個頭文件
#include "Patient/patientinterfaceinformation.h"
但是,"Patient/patientinterfaceinformation.h"文件中,意外在裏面添加了#include "Patient/patientinterface.h",這樣,在加載時,不斷的循環包含,導致報錯。
解決方案提示來源:https://stackoverflow.com/questions/19060039/qt-c-c2143-syntax-error-missing-before