【问题标题】:Qt on Mac saying symbol(s) not found for architecture x86_64 [duplicate]Mac上的Qt说找不到架构x86_64的符号[重复]
【发布时间】: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


    【解决方案1】:

    我碰巧终于在这个页面上找到了解决方案: Qt Creator: Undefined symbols for architecture x86_64 我试过了,它奏效了。但我不确定它是否完全正确,所以任何持有不同意见的人请在此处发布答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-20
      • 2020-09-09
      相关资源
      最近更新 更多