-1
나는 다음과 같은 헤더 파일이 Qt를 새로운 'C++ 라이브러리'프로젝트 생성 : 나는 객체를 구축하려고하면왜이 Qt 헤더 파일은 moc에 의해 파싱되지 않습니까?
#include "Test_global.h"
#include <QString>
#include <QTcpServer>
class TESTSHARED_EXPORT Test : QTcpServer
{
Q_OJECT
public:
Test();
~Test();
signals:
void NewMessage(QString);
};
(. 구현 파일은 기본적으로 비어)
을, I 오류 발생 :
Test.h:8: error: ISO C++ forbids declaration of ‘Q_OJECT’ with no type Test.h:10: error: expected ‘;’ before ‘public’ Test.cpp:3: error: definition of implicitly-declared 'Test::Test()'
따라서 moc
은 파일을 전혀 처리하지 않는 것 같습니다. 나는 무엇을 잘못 했는가?
왜 이렇게 잘못 작성된 질문입니까? 누군가 downvote를 설명해 주시겠습니까? –
Q_OJECT => Q_OBJECT? –
질문에 대한 downvote는 단어가 잘못되었거나 제자리에 없다는 것을 나타냅니다. 이것은 완벽하게 유효한 질문이었으며 잘 쓰여진 IMHO였습니다. –