gpt4 book ai didi

c++ - 在编译过程中找不到 QMainWindow

转载 作者:太空宇宙 更新时间:2023-11-04 11:48:31 26 4
gpt4 key购买 nike

我正在尝试编译 cutecash(一个 qt 项目)并且遇到了一些麻烦。我只是在做标准:

cmake .
make

但是,我遇到无法找到 QMainWindow 和 QString 等错误。这是错误:

http://pastebin.com/GGHTXE4N

In file included from /home/username/code/gnucash/src/gnc/fpo/ViewletView.hpp:14:0,
from /home/username/code/gnucash/src/gnc/fpo/FPO.hpp:4,
from /home/username/code/gnucash/src/gnc/fpo/moc_FPO.cxx:9:
/home/username/code/gnucash/src/gnc/mainwindow.hpp:26:23: fatal error: QMainWindow: No such file or directory
compilation terminated.
/home/username/code/gnucash/src/gnc/moc_RecentFileMenu.cxx:15:2: error: #error "This file was generated using the moc from 5.0.1. It"
/home/username/code/gnucash/src/gnc/moc_RecentFileMenu.cxx:16:2: error: #error "cannot be used with the include files from this version of Qt."
/home/username/code/gnucash/src/gnc/moc_RecentFileMenu.cxx:17:2: error: #error "(The moc has changed too much.)"
In file included from /home/username/code/gnucash/src/gnc/AccountItemModel.hpp:28:0,
from /home/username/code/gnucash/src/gnc/dashboard.hpp:34,
from /home/username/code/gnucash/src/gnc/moc_dashboard.cxx:9:
/home/username/code/gnucash/src/gnc/QofEventWrapper.hpp:37:19: fatal error: QString: No such file or directory
compilation terminated.
In file included from /home/username/code/gnucash/src/gnc/SplitListModel.hpp:29:0,
from /home/username/code/gnucash/src/gnc/moc_SplitListModel.cxx:9:
/home/username/code/gnucash/src/gnc/QofEventWrapper.hpp:37:19: fatal error: QString: No such file or directory
compilation terminated.

一些看起来相当重要的东西:

error: #error "This file was generated using the moc from 5.0.1. It"
error: #error "cannot be used with the include files from this version of Qt."
error: #error "(The moc has changed too much.)"

因此,每当我尝试安装 qt5-default(在 ubuntu 上)时,我都必须删除 qt4-default。如果我现在尝试编译,我会遇到同样的问题,无法找到 QMainWindow 和其他一些部分(例如 QAbstractItemDelegate)。

我也收到这个警告:

#error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC or -fPIE."

伴随着一些新的错误,这些错误似乎是由于无法找到项目而发生的。我在 ubuntu 13.04 上。

最佳答案

适合我的步骤:

关于c++ - 在编译过程中找不到 QMainWindow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19179271/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com