我看到一些C++錯誤,我不明白(我以Java爲中心編碼器):C++編譯問題
WarningNotification_if.cpp: In function 'void fireStatusBarMessage(char*, int)':
WarningNotification_if.cpp:62:14: error: expected type-specifier
WarningNotification_if.cpp:62:14: error: cannot convert 'int*' to 'WarningEventData*' in initialization
WarningNotification_if.cpp:62:14: error: expected ',' or ';'
下面是實際的代碼:
void fireStatusBarMessage(char *message = 0, int aTime = 0)
{
LmLocker locker((char *)__FILE__, __LINE__, &WarningEventUpdateMutex);
HMI_DEBUG(EVENT_DEBUG, (stderr, "Fire Status Bar Message\n"));
if (message != 0)
{
QString warningMessage = QString(message);
WarningEventData *theEventData =
new WarningEventData::WarningEventData();
theEventData->initialize();
theEventData->setMessageType(SESSION_STATUSBAR_TYPE);
theEventData->setCommand(APPEND_WARNING);
theEventData->setMessage(warningMessage);
theEventData->setModifier(aTime);
theEventData->setCategory(SESSION_STATUSBAR_TYPE);
WarningNotification::fireChange(SESSION_STATUSBAR_TYPE, theEventData);
} /* endif - message contents */
}
我需要是導入其他內容或使用某個-D標誌?
哪行代碼是62行? – Heatsink
「CPP」(來自您的頭銜)是C預處理器。這是你的意思嗎? –
@我覺得他的意思是「C++」。 –