QTE移植成功后的交叉编译

  • 时间:
  • 浏览:3

版权声明:本文内容由互联网用户自发贡献,版权归作者所有,本社区不拥有所有权,否则承担相关法律责任。为什么么让 您发现本社区含晒 涉嫌抄袭的内容,欢迎发送邮件至:

qte终于移植成功,为什么么让 在交叉编译当时人写的应用应用程序是老是提示有错误,错误如下:In file included from main.cpp:3:

./database.h:3:23: QSqlDatabase: No such file or directory

./database.h:4:20: QSqlQuery: No such file or directory

In file included from main.cpp:3:

./database.h: In function `bool createConnection()':

./database.h:8: error: `QSqlDatabase' was not declared in this scope

./database.h:8: error: expected `;' before "db"

./database.h:9: error: `db' was not declared in this scope

./database.h:8: warning: unused variable 'QSqlDatabase'

make: *** [main.o] 错误

提示这麼你这俩 个多文件或目录?明明在我的include里边为什么么么会会这麼?我想尽一切办法,又是该边境变量,又是删除编译文件重新编译,最后还是不行,我一遍一遍的查看include目录,最后发现错误提示的好几个 多文件在include/QtSql/下面而是让他把应用应用程序的含晒 文件目录该了一下后来为:#include<QSqlDatabase>,#include<QSqlQuery>改后来为:#include<QtSql/QSqlDatabase>,#include<QtSql/QSqlQuery>否则在后来的基础上增加好几个 多目录前缀,后来疑问报告 就处里了,你这俩 编译通过,为什么么让 下面又老出了错误,错误如下:songlist.cpp:6:20: QSqlQuery: No such file or directory

songlist.cpp:12: error: `songlist' has not been declared

songlist.cpp:12: error: ISO C++ forbids declaration of `songlist' with no type

songlist.cpp: In function `int songlist(QWidget*)':

songlist.cpp:12: error: only constructors take base initializers

songlist.cpp:16: error: `ui' was not declared in this scope

songlist.cpp:16: error: invalid use of `this' in non-member function

songlist.cpp:20: error: `model' was not declared in this scope

songlist.cpp:20: error: `QSqlTableModel' has not been declared

songlist.cpp:20: error: invalid use of `this' in non-member function

songlist.cpp:31: error: `model2' was not declared in this scope

songlist.cpp:31: error: `QSqlTableModel' has not been declared

songlist.cpp:31: error: invalid use of `this' in non-member function

songlist.cpp: At global scope:

songlist.cpp:46: error: expected constructor, destructor, or type conversion before '::' token

songlist.cpp:51: error: `songlist' is not a class or namespace

songlist.cpp: In function `void changeEvent(QEvent*)':

songlist.cpp:53: error: cannot call member function `virtual void QWidget::changeEvent(QEvent*)' without object

songlist.cpp:56: error: `ui' was not declared in this scope

songlist.cpp:56: error: invalid use of `this' in non-member function

songlist.cpp:56: warning: unused variable 'ui'

songlist.cpp: At global scope:

songlist.cpp:63: error: `songlist' is not a class or namespace

songlist.cpp: In function `void on_pushButton_clicked()':

songlist.cpp:65: error: `ui' was not declared in this scope

songlist.cpp:70: error: `model' was not declared in this scope

songlist.cpp:3000: error: `model2' was not declared in this scope

songlist.cpp:65: warning: unused variable 'ui'

songlist.cpp: At global scope:

songlist.cpp:87: error: `songlist' is not a class or namespace

songlist.cpp: In function `void on_pushButton_4_clicked()':

songlist.cpp:89: error: `ui' was not declared in this scope

songlist.cpp:90: error: `model2' was not declared in this scope

songlist.cpp:92: error: `Dir' was not declared in this scope

songlist.cpp:93: error: `prefix' was not declared in this scope

songlist.cpp:94: error: `PATH' was not declared in this scope

songlist.cpp:97: error: `play1' was not declared in this scope

songlist.cpp:97: warning: unused variable 'play1'

songlist.cpp: At global scope:

songlist.cpp:103: error: `songlist' is not a class or namespace

songlist.cpp: In function `void on_pushButton_3_clicked()':

songlist.cpp:105: error: `ui' was not declared in this scope

songlist.cpp:106: error: `model2' was not declared in this scope

songlist.cpp:105: warning: unused variable 'ui'

songlist.cpp: At global scope:

songlist.cpp:110: error: `songlist' is not a class or namespace

songlist.cpp: In function `void on_pushButton_2_clicked()':

songlist.cpp:115: error: invalid use of `this' in non-member function

database.h: At global scope:

database.h:7: warning: 'bool createConnection()' defined but not used

make: *** [songlist.o] 错误

交叉编译果然让他头大啊!从错误结束的地方找,加进头目录,发现疑问报告 还是这麼处里,于是就查看songlist.h发现里边哪此东西都不出,还提示任何的改动都为什么么让 造成文件内容丢失,于是就重新建立了好几个 多工程,继续交叉编译,前面的疑问报告 都处里了 ,为什么么让 又老出了新的错误,错误如下:main.o: In function `main':

main.cpp:(.text+0x210): undefined reference to `QSqlQuery::~QSqlQuery()'

main.cpp:(.text+0x220): undefined reference to `QSqlDatabase::~QSqlDatabase()'

main.cpp:(.text+0x794): undefined reference to `QSqlDatabase::addDatabase(QString const&, QString const&)'

main.cpp:(.text+0x858): undefined reference to `QSqlDatabase::~QSqlDatabase()'

main.cpp:(.text+0xbac): undefined reference to `QSqlDatabase::setDatabaseName(QString const&)'

main.cpp:(.text+0xc48): undefined reference to `QSqlDatabase::open()'

main.cpp:(.text+0xcf0): undefined reference to `QSqlQuery::~QSqlQuery()'

main.cpp:(.text+0xd00): undefined reference to `QSqlDatabase::~QSqlDatabase()'

main.cpp:(.text+0xd68): undefined reference to `QSqlDatabase::QSqlDatabase()'

main.cpp:(.text+0xd3000): undefined reference to `QSqlQuery::QSqlQuery(QString const&, QSqlDatabase)'

main.cpp:(.text+0xd90): undefined reference to `QSqlDatabase::~QSqlDatabase()'

main.cpp:(.text+0xe98): undefined reference to `QSqlQuery::exec(QString const&)'

main.cpp:(.text+0xef8): undefined reference to `QSqlDatabase::defaultConnection'

main.cpp:(.text+0xf90): undefined reference to `QSqlQuery::exec(QString const&)'

main.cpp:(.text+0x1038): undefined reference to `QSqlQuery::exec(QString const&)'

main.cpp:(.text+0x10e0): undefined reference to `QSqlQuery::exec(QString const&)'

main.cpp:(.text+0x1188): undefined reference to `QSqlQuery::exec(QString const&)'

main.cpp:(.text+0x12300): undefined reference to `QSqlQuery::exec(QString const&)'

main.o:main.cpp:(.text+0x12d8): more undefined references to `QSqlQuery::exec(QString const&)' follow

songlist.o: In function `songlist::songlist(QWidget*)':

songlist.cpp:(.text+0x1ac): undefined reference to `QSqlQuery::~QSqlQuery()'

songlist.cpp:(.text+0x47c): undefined reference to `QSqlDatabase::~QSqlDatabase()'

songlist.cpp:(.text+0x5b0): undefined reference to `QSqlDatabase::QSqlDatabase()'

songlist.cpp:(.text+0x5d8): undefined reference to `QSqlTableModel::QSqlTableModel(QObject*, QSqlDatabase)'

songlist.cpp:(.text+0x5f4): undefined reference to `QSqlDatabase::~QSqlDatabase()'

songlist.cpp:(.text+0x7c0): undefined reference to `QSqlDatabase::QSqlDatabase()'

songlist.cpp:(.text+0x7e8): undefined reference to `QSqlTableModel::QSqlTableModel(QObject*, QSqlDatabase)'

songlist.cpp:(.text+0x30004): undefined reference to `QSqlDatabase::~QSqlDatabase()'

songlist.cpp:(.text+0x8cc): undefined reference to `QSqlQueryModel::query() const'

songlist.cpp:(.text+0x9d0): undefined reference to `QSqlQuery::~QSqlQuery()'

songlist.o: In function `songlist::songlist(QWidget*)':

songlist.cpp:(.text+0xbb8): undefined reference to `QSqlQuery::~QSqlQuery()'

songlist.cpp:(.text+0xe88): undefined reference to `QSqlDatabase::~QSqlDatabase()'

songlist.cpp:(.text+0xfbc): undefined reference to `QSqlDatabase::QSqlDatabase()'

songlist.cpp:(.text+0xfe4): undefined reference to `QSqlTableModel::QSqlTableModel(QObject*, QSqlDatabase)'

songlist.cpp:(.text+0x30000): undefined reference to `QSqlDatabase::~QSqlDatabase()'

songlist.cpp:(.text+0x11cc): undefined reference to `QSqlDatabase::QSqlDatabase()'

songlist.cpp:(.text+0x11f4): undefined reference to `QSqlTableModel::QSqlTableModel(QObject*, QSqlDatabase)'

songlist.cpp:(.text+0x1210): undefined reference to `QSqlDatabase::~QSqlDatabase()'

songlist.cpp:(.text+0x12d8): undefined reference to `QSqlQueryModel::query() const'

songlist.cpp:(.text+0x13dc): undefined reference to `QSqlQuery::~QSqlQuery()'

songlist.o: In function `songlist::on_pushButton_clicked()':

songlist.cpp:(.text+0x2f38): undefined reference to `QSqlTableModel::submitAll()'

songlist.o: In function `songlist::on_pushButton_4_clicked()':

songlist.cpp:(.text+0x43d0): undefined reference to `QSqlTableModel::submitAll()'

songlist.o: In function `songlist::on_pushButton_3_clicked()':

songlist.cpp:(.text+0x47b8): undefined reference to `QSqlTableModel::submitAll()'

collect2: ld returned 1 exit status

make: *** [SKTV] 错误

后来错误在交叉编译QTE时,老出了好几个 多例如的,为什么么让 我重新解压再编译时却这麼了 ,我在网上也没找到例如的疑问报告 ,而是我只好再重新编译了,相同的错误还是老出,先静下心来想想,一夜这麼睡好!

终于处里了,疑问报告 终于处里了。疑问报告 是因为 :为什么么让 交叉编译是使用qte的qmake -project手动建立的工程文件,无法自动判断是否含晒 数据库,而是亲戚亲戚朋友为什么么让 使用了数据库既要手动在工程文件的最后加进语录,QT +=sql后来疑问报告 就迎刃而解了,困扰了我好几天的错误,也是最关键的错误,为什么么让 无法处里,整个应用应用程序将无法编译和移植!啊,松了一口气!

进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容。