我目前正在尝试构建和运行 QtQuick 2 应用程序,但出现重复符号错误:
ld: 55 duplicate symbols for architecture i386
这里有一些重复:
duplicate symbol __ZTS16QActionAnimation in:
/Users/momo/Qt5.2.1/5.2.1/ios/lib/libQt5Quick_iphonesimulator_debug.a(qquickanimation.o) /Users/momo/Qt5.2.1/5.2.1/ios/lib/libQt5Declarative_iphonesimulator_debug.a(moc_qdeclarativeanimation_p_p.o)
duplicate symbol __Z30_q_interpolateShortestRotationRdS_d in:
/Users/momo/Qt5.2.1/5.2.1/ios/lib/libQt5Declarative_iphonesimulator_debug.a(qdeclarativeanimation.o)
/Users/momo/Qt5.2.1/5.2.1/ios/lib/libQt5Quick_iphonesimulator_debug.a(qquickanimation.o)
duplicate symbol __Z31_q_interpolateClockwiseRotationRdS_d in:
/Users/momo/Qt5.2.1/5.2.1/ios/lib/libQt5Declarative_iphonesimulator_debug.a(qdeclarativeanimation.o)
/Users/momo/Qt5.2.1/5.2.1/ios/lib/libQt5Quick_iphonesimulator_debug.a(qquickanimation.o)
duplicate symbol __Z38_q_interpolateCounterclockwiseRotationRdS_d in: /Users/momo/Qt5.2.1/5.2.1/ios/lib/libQt5Declarative_iphonesimulator_debug.a(qdeclarativeanimation.o) /Users/momo/Qt5.2.1/5.2.1/ios/lib/libQt5Quick_iphonesimulator_debug.a(qquickanimation.o)
以下是项目文件的不同包含:
main.cpp :
#include <QtGui/QGuiApplication>
#include <QQmlContext>
#include <QScreen>
#include <QRect>
#include "qtquick2applicationviewer.h"
#include "dataobject.h"
int main(int argc, char *argv[])
{
...
}
dataobject.cpp :
#include "dataobject.h"
DataObject::DataObject(QObject *parent)
: QObject(parent)
{
}
...
dataobject.h :
#ifndef DATAOBJECT_H
#define DATAOBJECT_H
#include <QObject>
class DataObject : public QObject
{
...
};
#endif // DATAOBJECT_H
我发现奇怪的是有很多重复的符号,但我的文件中没有......这仅在使用 iOS 运行时发生,而不是在桌面(Mac 或 Windows)或 Android 上运行。
xcode项目有什么要改变的吗?
提前致谢