2

我正在尝试在 ubuntu 11.10 上编译 miktex 2.8。我已经安装了所有必要的库。但是在编译源代码时,我得到了这种错误:

RepositoryTableModel.cpp:(.text+0x48b): undefined reference to QAbstractItemModel::headerData(int, Qt::Orientation, int) const'
RepositoryTableModel.cpp:(.text+0x4c8): undefined reference to `QMetaObject::tr(char const*, char const*) const'
RepositoryTableModel.cpp:(.text+0x4d7): undefined reference to `QVariant::QVariant(QString const&)'
RepositoryTableModel.cpp:(.text+0x4f1): undefined reference to `QString::free(QString::Data*)'
RepositoryTableModel.cpp:(.text+0x518): undefined reference to `QMetaObject::tr(char const*, char const*) const'
RepositoryTableModel.cpp:(.text+0x527): undefined reference to `QVariant::QVariant(QString const&)'
RepositoryTableModel.cpp:(.text+0x545): undefined reference to `QString::free(QString::Data*)'
RepositoryTableModel.cpp:(.text+0x570): undefined reference to `QMetaObject::tr(char const*, char const*) const'
RepositoryTableModel.cpp:(.text+0x57f): undefined reference to `QVariant::QVariant(QString const&)'
RepositoryTableModel.cpp:(.text+0x59d): undefined reference to `QString::free(QString::Data*)'
RepositoryTableModel.cpp:(.text+0x5c8): undefined reference to `QMetaObject::tr(char const*, char const*) const'
RepositoryTableModel.cpp:(.text+0x5d7): undefined reference to `QVariant::QVariant(QString const&)'
RepositoryTableModel.cpp:(.text+0x5f5): undefined reference to `QString::free(QString::Data*)'
RepositoryTableModel.cpp:(.text+0x620): undefined reference to `QMetaObject::tr(char const*, char const*) const'
RepositoryTableModel.cpp:(.text+0x62f): undefined reference to `QVariant::QVariant(QString const&)'
RepositoryTableModel.cpp:(.text+0x64d): undefined reference to `QString::free(QString::Data*)'

这些只是其中的一小部分。我以为缺少一些库,我安装了 Qt SDK 但仍然遇到同样的问题。

任何人都可以帮忙吗?

4

1 回答 1

3

尝试这个:

apt-get install libqt4-dev

您需要-dev库包的版本来提供声明新数据类型、函数原型等的头文件。(大多数库包都提供-dev版本,尽管少数库包在主包中提供了头文件。)

于 2012-01-18T23:28:02.303 回答