【发布时间】:2016-10-23 13:21:24
【问题描述】:
您好,我正在使用 Qt 在 macOS 中创建扫雷游戏,每当我向我的类写入一些信号和插槽时,我的应用程序都无法编译。 Qt 说ld: symbol(s) not found for architecture x86_64
所以这是我的代码:
enum Status {
virgin,
flagged,
questioned,
revealed
};
class Cell : public QLabel
{
Q_OBJECT
public:
int atRow;
int atCol;
int content;//0 - 8 means the numbers of mines around the cell. -1 means it's a mine itself.
bool isMine;
Status status;
Cell(int atRow, int atCol);
Cell *NorthWest,
*North,
*NorthEast,
*East,
*SouthEast,
*South,
*SouthWest,
*West;
public slots:
void mousePressEvent(QMouseEvent *event);
};
我见过很多与我类似的问题,但我无法解决这个问题。我尝试添加CONFIG -= x86_64,但它仍然无法正常工作。我知道这是MOC 的事情,但我不知道如何解决它。
请有人帮助我!
【问题讨论】:
标签: c++ macos qt signals-slots macos-sierra