在编译Qt时报如下错误:
In file included from ../ZB/posix_qextserialport.h:8:0,
from ../ZB/qextserialport.h:7,
from ../ZB/mainwindow.h:40,
from ../ZB/main.cpp:4:
../ZB/qextserialbase.h:131:18: error: expected unqualified-id before numeric constant
make: *** [main.o] Error 1
在qextserialbase.h的131行处:
struct PortSettings{
BaudRateType BaudRate;
DataBitsType DataBits;
ParityType Parity;
StopBitsType StopBits;
FlowType FlowControl;
long Timeout_Millisec;
};
在serialport.h中有个宏定义:
#define BaudRate 9600
就把结构体里的BaudRate结替换掉了。
所以会出现这种情况。