我尝试构建MuseScore的xcode编译,该编译生成了Apple Mach-O链接(Id)错误。这是完整的错误:
Undefined symbols for architecture x86_64:
"qInitResources_mtest()", referenced from:
initMyResources() in libtestutils.a(testutils.o)
"qInitResources_musescorefonts_Free()", referenced from:
initMyResources() in libtestutils.a(testutils.o)
"qInitResources_musescorefonts_MScore()", referenced from:
initMyResources() in libtestutils.a(testutils.o)
"qInitResources_musescorefonts_Bravura()", referenced from:
initMyResources() in libtestutils.a(testutils.o)
"qInitResources_musescorefonts_MuseJazz()", referenced from:
initMyResources() in libtestutils.a(testutils.o)
"qInitResources_musescorefonts_FreeSerif()", referenced from:
initMyResources() in libtestutils.a(testutils.o)
"qInitResources_musescorefonts_Gootville()", referenced from:
initMyResources() in libtestutils.a(testutils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这些错误引用了程序的以下部分:
#include <QtTest/QtTest>
#include <QTextStream>
#include "config.h"
#include "libmscore/score.h"
#include "libmscore/note.h"
#include "libmscore/chord.h"
#include "libmscore/instrtemplate.h"
#include "omr/omr.h"
#include "testutils.h"
#include "mscore/musescore.h"
#include "mscore/preferences.h"
#include "libmscore/page.h"
#include "audio/midi/msynthesizer.h"
#include "libmscore/musescoreCore.h"
#include "mscore/shortcut.h"
#include "libmscore/xml.h"
#include "libmscore/excerpt.h"
#include "thirdparty/qzip/qzipreader_p.h"
static void initMyResources()
{
Q_INIT_RESOURCE(mtest);
Q_INIT_RESOURCE(musescorefonts_MScore);
Q_INIT_RESOURCE(musescorefonts_Gootville);
Q_INIT_RESOURCE(musescorefonts_Bravura);
Q_INIT_RESOURCE(musescorefonts_MuseJazz);
Q_INIT_RESOURCE(musescorefonts_FreeSerif);
Q_INIT_RESOURCE(musescorefonts_Free);
}
.
.
.
我研究了其他可能相关的问题,并且不断出现的一件事是我的项目可能在构建阶段中缺少链接库或目标。但是,我不知道如何知道哪一个,以及它是否可以解决问题。
要编译MuseScore,我在Mac OS 10.15.6上使用XCode 11.6。我还安装了QT 5.12.2
任何帮助将不胜感激!