3.qt编译安装笔记-关于xcb的问题

1.概要

2.关于xcb

(gdb) run
Starting program: /home/topeet/untitled/build/2-Debug/untitled 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/home/topeet/qt/q673/plugins/platforms"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: minimal, minimalegl, wayland, vnc, eglfs, offscreen, wayland-egl, linuxfb.


Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=549621529152, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: 没有那个文件或目录.
(gdb)

1.Qt 平台插件未正确加载

这个问题是由于 Qt 平台插件未正确加载导致的,尤其是 xcb 插件。xcb 是 Qt 在 X11 系统上使用的默认平台插件。如果无法加载,Qt 应用程序就无法启动。

以下是可能的原因及解决方法:


1. 检查 Qt 的平台插件路径

根据错误信息:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/home/topeet/qt/q673/plugins/platforms"

说明 Qt 正在尝试从 /home/topeet/qt/q673/plugins/platforms 加载插件,但找不到 libqxcb.so。你可以检查这个目录:

ls /home/topeet/qt/q673/plugins/platforms

如果确实缺少 libqxcb.so,可能是安装不完整或编译时依赖未满足。

解决方法

安装 xcb 相关依赖,并确保 Qt 编译时包含支持 X11 的库。

在基于 Debian/Ubuntu 的系统上,可以运行以下命令来安装必要的依赖:

 

sudo apt update
sudo apt install libxcb-xinerama0 libxcb-xinerama0-dev

如果你是从源码编译 Qt,则需要重新配置并编译,确保启用了 X11 支持:

 

cd /path/to/qt/source
./configure -platform linux-g++ -xcb
make
sudo make install

2. 设置 QT_QPA_PLATFORM_PLUGIN_PATH 环境变量

如果插件存在,但 Qt 没有正确查找到它,你可以通过设置 QT_QPA_PLATFORM_PLUGIN_PATH 环境变量来指定插件路径。例如:

 

export QT_QPA_PLATFORM_PLUGIN_PATH=/home/topeet/qt/q673/plugins/platforms

然后重新运行程序。


3. 检查动态链接库依赖

即使插件文件存在,也有可能其依赖的动态链接库缺失。可以使用 ldd 命令检查 libqxcb.so 的依赖:

 

ldd /home/topeet/qt/q673/plugins/platforms/libqxcb.so

如果有未找到的库(not found),需要安装相应的包。例如,如果缺少 libxcb-icccm.so 或类似库,可以运行:

 

sudo apt install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0


4. 检查是否使用了错误的 Qt 版本

如果你在开发环境中安装了多个版本的 Qt,程序可能运行时链接了错误的库。确保运行时所使用的 Qt 版本与编译时一致。

使用以下命令检查当前程序所使用的 Qt 库路径:

 

ldd /home/topeet/untitled/build/2-Debug/untitled | grep Qt

如果发现链接的路径与预期不一致,可以调整 LD_LIBRARY_PATH 环境变量。例如:

 

export LD_LIBRARY_PATH=/home/topeet/qt/q673/lib:$LD_LIBRARY_PATH


5. 重新安装或重新编译 Qt

如果上述方法均无效,可以尝试重新安装 Qt,或者从源码重新编译。如果是通过包管理器安装的 Qt,运行以下命令重新安装:

 

sudo apt install qt6-base-dev

若需要自定义编译,建议确保安装所有必要依赖后再进行编译。


6. 使用调试信息进一步排查

在 gdb 中,可以查看崩溃的详细堆栈信息,以确认问题是否与其他库或路径有关:

(gdb) bt


总结

根据错误信息,最可能的原因是缺少 xcb 插件或其依赖。建议按照以下顺序排查并解决问题:

  1. 检查 /home/topeet/qt/q673/plugins/platforms 目录是否包含 libqxcb.so
  2. 安装 xcb 相关依赖。
  3. 设置 QT_QPA_PLATFORM_PLUGIN_PATH 环境变量。
  4. 确保运行时 Qt 库路径正确。
  5. 如果仍然无效,重新安装或重新编译 Qt。

完成上述步骤后,再次运行程序,应该可以解决问题。

2../configure -platform linux-g++ -xcb 

在运行 ./configure 命令时,使用 -platform linux-g++ 和 -xcb 参数的目的是为 Qt 的编译配置指定目标平台和启用的功能。在这个上下文中:

  • -platform linux-g++:指定编译的目标平台为 Linux,并使用 g++ 作为编译器。
  • -xcb:启用对 X11 图形系统的支持,这是通过 xcb(X C Binding)库实现的。

如果你的系统中缺少 xcb 及其相关开发库,编译可能会失败或生成的 Qt 库可能无法正常运行。因此,在运行这个配置命令之前,确保安装了必要的开发包是很重要的。

安装必要的依赖

在基于 Debian/Ubuntu 的系统上,你可以通过以下命令安装 xcb 和其他相关开发库:

sudo apt update
sudo apt install build-essential libxcb1-dev libxcb-glx0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-shm0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-xfixes0-dev

配置和编译 Qt

  1. 进入 Qt 源码目录

    cd /path/to/qt/source

  2. 运行配置脚本

    ./configure -platform linux-g++ -xcb

    根据你的需求,还可以添加其他参数。例如,如果你希望启用 OpenGL 支持,可以添加 -opengl es2 或其他适当的参数。

  3. 编译和安装

    make -j$(nproc) # 使用所有可用的CPU内核进行编译
    sudo make install

验证安装

编译完成后,确保正确设置了环境变量,以便程序能够找到新编译的 Qt 库:

export LD_LIBRARY_PATH=/path/to/qt/installation/lib:$LD_LIBRARY_PATH
export QT_QPA_PLATFORM_PLUGIN_PATH=/path/to/qt/installation/plugins/platforms

然后,尝试运行你的 Qt 应用程序,检查是否能够正常启动。

其他注意事项

  • 如果你正在使用特定的开发环境(如 Qt Creator),确保在该环境中也配置了正确的 Qt 版本。
  • 如果仍然遇到问题,可以查看 Qt 的编译日志和运行时输出,以获取更多调试信息。

通过这些步骤,你应该能够成功编译并运行支持 xcb 的 Qt 应用程序。

3.qt 编译安装,支持添加插件的编译吗,比如我编译完了但是没有安装xcb,这时候我把xcb 加上,再编译,可以吗,不清除之前编译的内容 

3.ubuntu 上qt 安装 xcb,qt 本身安装库都有什么,依赖的库都有什么 

在 Ubuntu 上安装 Qt 和 xcb 相关库时,需要了解 Qt 本身安装的库以及它依赖的库。以下是对这些问题的详细解答:

Qt 安装的库

Qt 是一个跨平台的 C++ 图形用户界面应用程序框架,它提供了丰富的库来支持应用程序的开发。在 Ubuntu 上安装 Qt 时,通常会包含以下核心库和工具:

  • Qt Core:提供非 GUI 的功能,如信号和槽、事件处理、定时器、线程等。
  • Qt GUI:提供图形用户界面元素,如窗口、按钮、文本框等。
  • Qt Widgets:提供一套经典的桌面风格的用户界面组件。
  • Qt Network:提供网络功能,如 TCP/IP 套接字、HTTP 客户端和服务器等。
  • Qt SQL:提供数据库访问功能,支持多种数据库系统。
  • Qt Multimedia:提供多媒体功能,如音频和视频播放、摄像头访问等。
  • Qt WebEngine:提供对 Web 内容的支持,如嵌入网页、与网页交互等。
  • Qt Quick:提供一套用于创建高性能、流畅的用户界面的框架。
  • Qt Tools:提供开发过程中使用的工具,如 Qt Creator 集成开发环境、qmake 构建工具等。

Qt 依赖的库

Qt 在编译和运行时需要依赖多个系统库。以下是一些常见的 Qt 依赖库:

  • XCB(X Window System Client Library):用于与 X Window 系统进行通信,提供窗口管理、事件处理等功能。在 Ubuntu 上,可以通过安装 libxcb1-dev 等包来获取。
  • OpenGL:用于图形渲染,提供高性能的 2D 和 3D 图形功能。在 Ubuntu 上,可以通过安装 libgl1-mesa-dev 等包来获取。
  • FontConfig:用于字体管理,提供字体选择、配置等功能。在 Ubuntu 上,可以通过安装 libfontconfig1-dev 等包来获取。
  • FreeType:一个开源的、高质量的字体渲染引擎。在 Ubuntu 上,可以通过安装 libfreetype6-dev 等包来获取。

安装 xcb 相关库

如果在 Ubuntu 上安装 Qt 后发现缺少 xcb 相关库,可以通过以下命令进行安装:

sudo apt update
sudo apt install libxcb1-dev libxcb-glx0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-shm0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-xfixes0-dev

这些包提供了 xcb 库的开发文件和头文件,使得 Qt 应用程序能够正常编译和运行。

总结

在 Ubuntu 上安装 Qt 和 xcb 相关库时,需要了解 Qt 本身安装的库以及它依赖的库。Qt 提供了丰富的库来支持应用程序的开发,而 xcb 等系统库则是 Qt 运行所必需的依赖。通过安装这些库,可以确保 Qt 应用程序能够正常编译和运行。

4.假如我安装了xcb,这和没安装xcb对比,qt的安装目录会多出些什么文件 

在 Ubuntu 上安装 xcb 后,对于 Qt 的安装目录来说,可能会多出一些与 xcb 插件或相关功能相关的文件。这些文件通常位于 Qt 的插件目录中,特别是与平台插件(platform plugins)相关的部分。以下是可能的情况:

可能多出的文件

  1. 平台插件文件

    • 当 Qt 应用程序需要在 X Window 系统上运行时,它需要使用 xcb 作为底层通信库。因此,安装 xcb 后,Qt 的安装目录中的 plugins/platforms 目录下可能会多出与 xcb 相关的平台插件文件。
    • 例如,可能会多出 libqxcb.so 或类似名称的文件,这是 Qt 的 xcb 平台插件,用于与 xcb 进行交互。
  2. 配置文件或元数据

    • Qt 的安装目录可能还包含一些与插件配置或元数据相关的文件,这些文件可能记录了 xcb 插件的存在或相关配置信息。
    • 这些文件可能位于 Qt 的安装目录的某个子目录中,具体位置可能因 Qt 的版本和安装方式而异。

注意事项

  • 安装路径:Qt 的安装路径可能因安装方式(如通过包管理器安装、从源代码编译安装等)而异。通常,通过包管理器安装的 Qt 会安装在系统的标准路径下,而通过源代码编译安装的 Qt 则可以选择自定义的安装路径。
  • 插件目录:Qt 的插件目录是动态加载插件的位置。在 Qt 的安装目录中,插件目录通常位于 plugins 目录下,并根据插件类型(如平台插件、图像格式插件等)进一步细分。
  • 依赖性:Qt 的 xcb 平台插件依赖于 xcb 库。因此,即使 Qt 的安装目录中包含 xcb 平台插件,如果没有正确安装 xcb 库,Qt 应用程序也可能无法正常运行。

结论

安装了 xcb 后,对于 Qt 的安装目录来说,最显著的变化可能是 plugins/platforms 目录下多出了与 xcb 相关的平台插件文件。这些文件使得 Qt 应用程序能够在 X Window 系统上正常运行,并利用 xcb 提供的底层通信功能。如果您在 Qt 的安装目录中没有找到这些文件,可能是因为 Qt 的版本或安装方式不支持 xcb 平台插件,或者 xcb 库尚未正确安装。

5.我通过编译安装的qt插件目录中没有libqxcb.so,是否就证明我没有成功安装libqxcb.so 

如果您通过编译安装的 Qt 插件目录中没有 libqxcb.so 文件,这并不意味着您没有成功安装 libqxcb.so。可能存在以下几种情况:

  1. 编译配置问题
    • 在编译 Qt 时,可能没有启用 xcb 支持。Qt 的编译配置可以通过 ./configure 脚本进行自定义。如果您在编译时没有添加相应的参数来启用 xcb 支持,那么编译出的 Qt 可能不包含 libqxcb.so
    • 解决方案:在编译 Qt 时,确保添加了 -xcb 参数。例如:

      ./configure -prefix /opt/build -opensource -confirm-license -skip qtlocation -nomake examples -nomake tests -xcb

    依赖库未安装
    • 即使启用了 xcb 支持,如果系统中缺少必要的依赖库,Qt 的编译过程也可能无法成功生成 libqxcb.so
    • 解决方案:确保系统中安装了 xcb 所需的依赖库。您可以使用如下命令安装:

      sudo apt update
      sudo apt-get install libdrm-dev libxcomposite-dev libxcursor-dev libxi-dev libxtst-dev libxcb*
    编译过程中的错误
    • 在编译 Qt 的过程中,如果出现错误,可能导致某些组件未能正确编译。检查编译输出日志,看是否有与 xcb 相关的错误信息。
    • 解决方案:解决编译过程中的错误,并重新编译 Qt。
  2. 安装路径问题
    • 有可能 libqxcb.so 文件已正确编译,但未被安装在您期望的插件目录中。
    • 解决方案:检查 Qt 的编译配置和安装路径,确保插件文件被安装在正确的位置。
  3. 版本或配置问题
    • 某些 Qt 版本可能默认不包含 xcb 支持,或者需要特定的配置才能启用。
    • 解决方案:查阅您所使用的 Qt 版本的文档,了解如何正确启用 xcb 支持。

建议的解决步骤

  1. 检查编译配置:回顾您的编译命令,确保启用了 xcb 支持。

  2. 安装依赖库:确保系统中安装了所有必要的依赖库。

  3. 重新编译 Qt:清除之前的编译结果,使用正确的配置重新编译 Qt。

  4. 检查安装路径:编译完成后,检查 Qt 的安装目录,确认 libqxcb.so 文件是否存在于 plugins/platforms 目录下。

  5. 查阅文档:如果问题仍未解决,查阅您所使用的 Qt 版本的官方文档,获取更多关于如何启用 xcb 支持的信息。

通过以上步骤,您应该能够确定是否成功安装了 libqxcb.so,并解决可能存在的问题。

3.重新构建 

1.qt安装说明

HOW TO BUILD Qt 6
=================


Synopsis
========

System requirements
-------------------

* C++ compiler supporting the C++17 standard
* CMake
* Ninja
* Python 3

For more details, see also https://doc.qt.io/qt-6/build-sources.html

Linux, Mac:
-----------

```
cd <path>/<source_package>
./configure -prefix $PWD/qtbase
cmake --build .
```

Windows:
--------

1. Open a command prompt.
2. Ensure that the following tools can be found in the path:
 * Supported compiler (Visual Studio 2019 or later, or MinGW-builds gcc 11.2 or later)
 * Python 3 ([https://www.python.org/downloads/windows/] or from Microsoft Store)

```
cd <path>\<source_package>
configure -prefix %CD%\qtbase
cmake --build .
```

More details follow.


Build!
======

Qt is built with CMake, and a typical
`configure && cmake --build .` build process is used.

If Ninja is installed, it is automatically chosen as CMake generator.

Some relevant configure options (see configure -help):

* `-release` Compile and link Qt with debugging turned off.
* `-debug` Compile and link Qt with debugging turned on.

Example for a release build:

```
./configure -prefix $PWD/qtbase
cmake --build .
```

Example for a developer build:
(enables more autotests, builds debug version of libraries, ...)

```
./configure -developer-build
cmake --build .
```

 See output of `./configure -help` for documentation on various options to
 configure.

 The above examples will build whatever Qt modules have been enabled
 by default in the build system.

 It is possible to build selected repositories with their dependencies by doing
 a `ninja <repo-name>/all`.  For example, to build only qtdeclarative,
 and the modules it depends on:

```
./configure
ninja qtdeclarative/all
```

This can save a lot of time if you are only interested in a subset of Qt.


Hints
=====

The submodule repository `qtrepotools` contains useful scripts for
developers and release engineers. Consider adding qtrepotools/bin
to your `PATH` environment variable to access them.


Building Qt from git
====================

See http://wiki.qt.io/Building_Qt_6_from_Git and README.git
for more information.
See http://wiki.qt.io/Qt_6 for the reference platforms.


Documentation
=============

After configuring and compiling Qt, building the documentation is possible by running

```
cmake --build . --target docs
```

After having built the documentation, you need to install it with the following
command:

```
cmake --build . --target install_docs
```

The documentation is installed in the path specified with the
configure argument `-docdir`.

Information about Qt's documentation is located in qtbase/doc/README

Note: Building the documentation is only tested on desktop platforms.

根据您提供的 Qt 6 构建指南,以下是详细的构建步骤和一些建议,以确保您能够成功编译 Qt 6:

系统要求

在开始之前,请确保您的系统满足以下要求:

  • 支持 C++17 标准的 C++ 编译器
  • CMake
  • Ninja(可选,但推荐)
  • Python 3

构建步骤

1. 准备工作

首先,确保所有必需的工具和库已经安装在您的系统上。对于 Linux,您可以使用包管理器来安装这些工具。例如,在 Ubuntu 上,您可以运行以下命令:

sudo apt update
sudo apt-get install build-essential cmake ninja-build python3

对于 Windows,您需要确保 Visual Studio 或 MinGW 以及 Python 3 已安装,并在系统路径中可访问。

2. 获取 Qt 源代码

从 Qt 官方网站或其镜像下载 Qt 6 的源代码包,并解压到您的工作目录。

cd <path>/<source_package>

3. 配置构建

在 Linux 或 macOS 上,您可以使用以下命令配置构建:

./configure -prefix $PWD/qtbase

在 Windows 上,您可以使用以下命令:

cd <path>\<source_package>
configure -prefix %CD%\qtbase
  • -prefix 选项指定 Qt 将被安装到的目录。
  • 您可以使用其他选项来定制构建,例如 -release 或 -debug
4. 构建 Qt

使用 CMake 和 Ninja 构建 Qt:

cmake --build .

如果您没有安装 Ninja,CMake 将默认使用 Makefiles。在这种情况下,您可以使用以下命令:

cmake --build . -- -j$(nproc)

-j$(nproc) 选项会利用所有可用的 CPU 核心来加速编译过程。

5. 安装(可选)

如果您希望将 Qt 安装到系统目录中,可以运行以下命令:

cmake --install .

构建文档(可选)

如果您需要构建 Qt 的文档,可以在配置和编译后运行以下命令:

cmake --build . --target docs
cmake --build . --target install_docs

文档将被安装到配置时指定的 -docdir 路径中。

提示

  • 使用 Ninja:如果可能,尽量使用 Ninja 作为构建工具,因为它通常比 Makefiles 更快。
  • 定制构建:使用 ./configure -help 查看所有可用的配置选项,以根据您的需求定制构建。
  • 开发构建:如果您是开发者或需要调试功能,可以使用 -developer-build 选项。
  • 部分构建:如果您只对 Qt 的某些模块感兴趣,可以使用 ninja <repo-name>/all 来构建特定模块及其依赖项,以节省时间。

从 Git 构建

如果您希望从 Qt 的 Git 仓库构建 Qt 6,请参考 Qt 官方文档中的相关指南:Building Qt 6 from Git

通过以上步骤和建议,您应该能够成功构建 Qt 6。如果在构建过程中遇到问题,请查阅 Qt 的官方文档或在社区中寻求帮助。

2.判断Ninja是否安装 

要判断 Ninja 是否已安装在您的系统上,您可以在终端或命令提示符中运行以下命令:

ninja --version

预期输出

如果 Ninja 已安装,您将看到类似以下内容的输出,显示 Ninja 的版本号:

1.10.2

版本号可能会根据您安装的版本而有所不同。

未安装时的处理

如果系统提示找不到 ninja 命令,则说明 Ninja 未安装。在这种情况下,您可以根据您的操作系统使用以下方法安装 Ninja:

在 Linux 上
  • Debian/Ubuntu

    sudo apt update
    sudo apt-get install ninja-build
  • Fedora

    sudo dnf install ninja-build

  • Arch Linux

    sudo pacman -S ninja

在 macOS 上

您可以使用 Homebrew 安装 Ninja:

brew install ninja

在 Windows 上
  1. 下载 Ninja 的可执行文件:

    • 访问 Ninja 的官方 GitHub 发布页面
    • 下载适合您系统的可执行文件(通常是 ninja-win.zip)。
  2. 解压下载的文件,并将 ninja.exe 放置在您的系统路径中,或者直接在命令提示符中导航到解压目录来运行它。

通过这些步骤,您可以轻松判断 Ninja 是否已安装,并在必要时进行安装。

3../configure -prefix $PWD/qtbase 

看起来你正在尝试配置 Qt 的构建过程,特别是 Qt Base 模块。使用 ./configure 脚本时,你可以指定各种选项来定制构建。在你的命令中,你使用了 -prefix 选项来指定安装目录。以下是关于这个命令的一些详细信息:

命令解释

./configure -prefix $PWD/qtbase

  • ./configure:这是 Qt 源代码目录中的一个脚本,用于配置 Qt 的构建选项。在运行这个脚本之前,你需要确保自己在 Qt 源代码的根目录下。

  • -prefix $PWD/qtbase:这个选项指定了 Qt 安装的目标目录。在这个例子中,$PWD 是一个环境变量,代表当前工作目录。因此,-prefix $PWD/qtbase 将安装目录设置为当前目录下的 qtbase 子目录。

其他常用选项

在配置 Qt 时,你可能还会用到其他选项。以下是一些常见的选项:

  • -opensource:选择开源许可协议。
  • -confirm-license:自动确认许可协议。
  • -platform:指定目标平台(例如,-platform linux-g++)。
  • -release 或 -debug:构建发布版或调试版。
  • -nomake tests:不构建测试用例。
  • -nomake examples:不构建示例代码。

示例

假设你在一个 Linux 系统上,并且希望构建一个开源的 Qt 发布版,你可能会使用如下命令:

 

./configure -prefix $PWD/qtbase -opensource -confirm-license -platform linux-g++ -release -nomake tests -nomake examples

配置后的步骤

运行 ./configure 成功后,你可以继续执行以下步骤来构建和安装 Qt:

  1. 构建 Qt

    make -j$(nproc)

    使用 -j$(nproc) 选项可以利用所有可用的 CPU 核心来加速构建过程。

  2. 安装 Qt

    make install

这将把 Qt 安装到你通过 -prefix 选项指定的目录中。确保在构建和安装过程中没有错误信息,以确保 Qt 能够正常工作。

4.缓存文件(CMakeCache.txt)和 CMakeFiles 目录保留了先前的配置信息,导致冲突

topeet@topeet:~/qt/qt_6_7_3$ ./configure -prefix $PWD/qtbase
+ mkdir -p qtbase
+ cd qtbase
+ exec /home/topeet/qt/qt_6_7_3/qtbase/configure -top-level -prefix /home/topeet/qt/qt_6_7_3/qtbase
'/usr/bin/cmake' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-DCMAKE_INSTALL_PREFIX=/home/topeet/qt/qt_6_7_3/qtbase' '-G' 'Ninja' '/home/topeet/qt/qt_6_7_3'
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:1077 (message):
  CMake exited with code 1.

这个错误信息表明,CMake 在配置过程中遇到了一个与生成器相关的问题。具体来说,当前尝试使用的生成器是 Ninja,但先前使用的生成器是 Unix Makefiles。CMake 缓存文件(CMakeCache.txt)和 CMakeFiles 目录保留了先前的配置信息,导致冲突。

解决方法

要解决这个问题,你可以尝试以下几个步骤:

  1. 清理先前的构建文件
    删除现有的 CMake 缓存文件和目录,以确保没有旧的配置信息干扰新的配置。

    rm -rf qtbase/CMakeCache.txt qtbase/CMakeFiles

    如果你的 qtbase 目录是空的(除了刚刚创建的缓存文件),你也可以直接删除整个目录并重新创建:

    rm -rf qtbase
    mkdir qtbase
  2. 重新运行配置脚本
    在清理之后,重新运行 ./configure 脚本。

    ./configure -prefix $PWD/qtbase

  3. 确保 Ninja 可用
    确保 Ninja 已安装并在你的系统路径中可用。如果你之前没有安装 Ninja,可以使用以下命令进行安装:

    • 在 Ubuntu 上

      sudo apt-get install ninja-build

    • 在 macOS 上

      brew install ninja

    • 在 Windows 上

      从 Ninja 的 GitHub 发布页面下载并安装。

检查 CMakeLists.txt

如果上述步骤仍然无法解决问题,确保你的 Qt 源代码目录中的 CMakeLists.txt 文件没有错误,并且你正在使用正确版本的 CMake。Qt 6.7.3 可能需要特定版本的 CMake,确保你的 CMake 版本满足 Qt 的最低要求。

通过这些步骤,你应该能够解决生成器不匹配的问题,并成功配置 Qt 的构建。

5.错误的解释器: 没有那个文件或目录

topeet@topeet:~/qt/qt673$ ./configure -prefix $PWD/qtbase
bash: ./configure: /bin/sh^M: 错误的解释器: 没有那个文件或目录

这个错误信息表明,configure 脚本的解释器行可能包含了错误的格式,通常是因为文件中存在不兼容的换行符(例如,Windows 风格的换行符 \r\n 而不是 Unix 风格的 \n)。

解决方法

  1. 检查并修复换行符

    你可以使用 dos2unix 工具来转换文件的换行符格式。如果你的系统上还没有安装 dos2unix,可以先安装它:

    • 在 Ubuntu 上

      sudo apt-get install dos2unix

      在 macOS 上

      brew install dos2unix

    然后,运行以下命令来修复 configure 脚本:

    dos2unix configure

  2. 手动检查和编辑

    如果你不想安装 dos2unix,也可以手动检查和编辑 configure 文件。使用文本编辑器打开 configure 文件,确保第一行(解释器行)是:

    #!/bin/sh

    并确保该行末尾没有其他字符或空格。整个文件应使用 Unix 风格的换行符(\n)。

  3. 重新下载源代码

    如果问题仍然存在,可能是源代码在下载过程中被损坏。尝试重新下载 Qt 的源代码压缩包,并确保在解压时没有问题。

  4. 验证文件权限

    确保 configure 脚本具有执行权限。如果没有,可以通过以下命令添加执行权限:

    chmod +x configure

通过这些步骤,你应该能够修复 configure 脚本的解释器错误,并成功运行配置命令。

6.ubuntu 查看文件编码 

在 Ubuntu 中查看文件的编码可以通过多种方式进行。以下是一些常用的方法和工具:

1. 使用 file 命令

file 命令是一个简单的命令行工具,可以用来检测文件的类型以及某些情况下的编码。虽然它不能直接告诉你具体的字符编码(如 UTF-8、GBK 等),但可以给你一些基本信息。

file yourfile.txt

2. 使用 uchardet 或 chardet

uchardet 和 chardet 是专门用于检测文件编码的工具。这些工具会分析文件内容并尝试确定使用的字符编码。

  • uchardet

    如果 uchardet 没有安装,你可以通过以下命令安装它:

    sudo apt-get install uchardet

    然后使用它来检测文件编码:

    uchardet yourfile.txt

  • chardet

    chardet 是 Python 的一个库,但通常也提供了一个命令行工具。如果你使用的是 Python 3,可以通过以下方式安装:

    sudo apt-get install python3-chardet

    然后你可能需要找到 chardet 的命令行接口(有时直接安装后没有命令行工具,但你可以通过 Python 脚本使用它)。

    或者,如果你有 Python 环境,可以直接使用以下命令(假设你有 pip):

    pip install chardet

    然后创建一个简单的 Python 脚本来检测文件编码:

    import chardet
    
    with open('yourfile.txt', 'rb') as file:
        print(chardet.detect(file.read()))
3. 使用文本编辑器

许多现代文本编辑器(如 VSCode、Sublime Text、Gedit 等)可以自动检测并显示文件的编码。你可以打开文件,然后查看编辑器的状态栏或设置菜单,通常可以找到有关文件编码的信息。

4. 使用 iconv

虽然 iconv 主要用于转换文件编码,但你可以先尝试用它来列出支持的编码列表,间接了解可能的编码格式:

iconv --list

不过,iconv 本身不能直接检测文件编码。

通过上述方法,你应该能够确定文件的编码格式,从而进行相应的处理或转换。

7. Windows 系统上创建或编辑的 

根据 file 命令的输出,你的 configure 脚本是一个 POSIX shell 脚本,使用 ASCII 文本格式,但具有 CRLF(\r\n)换行符。这表明该文件可能是在 Windows 系统上创建或编辑的,然后复制到你的 Ubuntu 系统中。

修复方法

为了确保脚本在 Unix/Linux 系统上正常运行,需要将换行符转换为 Unix 风格的 LF(\n)。以下是几种解决方法:

1. 使用 dos2unix 工具

dos2unix 是一个专门用于转换 Windows 风格换行符为 Unix 风格的工具。

  • 首先,确保 dos2unix 已安装:

    sudo apt-get install dos2unix

  • 然后,运行以下命令转换 configure 脚本:

    dos2unix ./configure

2. 使用 sed 命令

如果你不想安装额外的软件,可以使用 sed 来删除多余的 \r 字符:

sed -i 's/\r$//' ./configure

3. 使用文本编辑器

你可以使用支持 Unix 换行符的文本编辑器(如 VSCode、Sublime Text、Gedit 等)打开并重新保存该文件。确保在保存时选择 Unix 风格的换行符。

  • VSCode:打开文件,点击右下角的换行符声明(通常显示为 CRLF),选择 LF
  • Sublime Text:打开文件,然后在菜单中选择 View > Line Endings > Unix
  • Gedit:打开文件,然后在菜单中选择 Edit > Preferences,确保选择了 Display line numbers 和正确的换行符格式。
4. 手动创建新文件

如果文件内容不多,可以手动复制内容到一个新的文件中,并确保在保存时使用 Unix 风格的换行符。

验证修复

完成上述步骤后,可以再次使用 file 命令验证文件的换行符格式:

file ./configure

正确的输出应不再包含 with CRLF line terminators

通过这些方法,你应该能够修复 configure 脚本的换行符格式,从而成功运行它。

8.文件存在但是执行脚本找不到

topeet@topeet:~/qt/qt673$ ./configure -prefix $PWD/qtbase
+ mkdir -p qtbase
+ cd qtbase
+ exec /home/topeet/qt/qt673/qtbase/configure -top-level -prefix /home/topeet/qt/qt673/qtbase
./configure: 18: exec: /home/topeet/qt/qt673/qtbase/configure: not found

这个错误信息表明,脚本尝试执行 /home/topeet/qt/qt673/qtbase/configure 文件,但该文件不存在或无法执行。以下是一些可能的原因和解决方法:

可能原因和解决方法

  1. 路径错误

    • 确认 qtbase 目录是否正确创建,并且在该目录下是否有一个名为 configure 的可执行脚本。
    • 检查路径是否正确,确保没有拼写错误或不必要的路径嵌套。
  2. 文件权限问题

    • 确保 configure 脚本具有执行权限。你可以通过以下命令为 configure 添加执行权限:

      chmod +x ./configure

  3. 错误的脚本逻辑

    • 从错误信息来看,脚本似乎在尝试递归调用自身。检查 configure 脚本的内容,确保没有逻辑错误导致它试图执行自身或错误的路径。
  4. 文件丢失或损坏

    • 确保 Qt 源代码包在下载和解压过程中没有丢失文件。可以尝试重新下载并解压 Qt 源代码。
  5. 环境变量或参数问题

    • 检查传递给 ./configure 的参数是否正确,尤其是 -prefix 参数。
    • 确认 $PWD 环境变量是否返回了当前工作目录的正确路径。

检查和修复步骤

  1. 检查目录和文件

    ls -l qtbase

    确认 qtbase 目录中是否存在 configure 脚本。

  2. 验证脚本路径和权限

    • 确保 configure 脚本的路径正确。

    • 检查和设置执行权限:

      chmod +x ./configure

  3. 重新下载和解压源代码

    • 如果问题仍然存在,考虑重新下载 Qt 的源代码压缩包,并确保在解压时没有错误。
  4. 手动执行配置脚本

    • 进入 qtbase 目录,然后尝试手动执行 configure 脚本:

      cd qtbase
      ./configure -prefix /home/topeet/qt/qt673/qtbase

通过这些步骤,你应该能够找到并修复导致 configure 脚本无法执行的问题。如果问题仍然存在,建议仔细检查 configure 脚本的内容和逻辑。

注:问题原因估计也和编码有关,后来使用linux下生成的文件重新构建了

9.ubuntu 查看一个文件是否存在 

在 Ubuntu 或其他 Unix/Linux 系统中,你可以使用多种方法来检查一个文件是否存在。以下是一些常用的方法:

使用 ls 命令

  1. 简单检查

    • 你可以使用 ls 命令来查看文件是否存在。如果文件存在,ls 会列出文件信息;如果不存在,则不会有输出。
     

    ls /path/to/file

    • 如果希望避免输出文件信息,只关心文件是否存在,可以将输出重定向到 /dev/null
     

    ls /path/to/file > /dev/null 2>&1 && echo "File exists" || echo "File does not exist"

使用 test 或 [ 命令

  1. 使用 test 命令

    • test 是一个用于条件评估的内置命令,可以用来检查文件是否存在。
     

    test -e /path/to/file && echo "File exists" || echo "File does not exist"

    • 你也可以使用方括号 [],它们是 test 命令的简写形式:
     

    [ -e /path/to/file ] && echo "File exists" || echo "File does not exist"

使用 if 语句

  1. 在脚本中使用 if 语句
    • 如果你在编写一个 Bash 脚本,可以使用 if 语句结合 -e 选项来检查文件是否存在。

    if [ -e /path/to/file ]; then
        echo "File exists"
    else
        echo "File does not exist"
    fi

其他选项

  • -f /path/to/file:检查文件是否存在且是一个普通文件。
  • -d /path/to/directory:检查目录是否存在。

示例

假设你要检查文件 /home/topeet/example.txt 是否存在:

if [ -e /home/topeet/example.txt ]; then
    echo "File exists"
else
    echo "File does not exist"
fi

通过这些方法,你可以轻松地在 Ubuntu 系统上检查一个文件是否存在。选择哪种方法取决于你的具体需求和上下文。

10.找不到文件的排查方法 

topeet@topeet:~/qt/qt673$ ./configure -prefix $PWD/qtbase
+ mkdir -p qtbase
+ cd qtbase
+ exec /home/topeet/qt/qt673/qtbase/configure -top-level -prefix /home/topeet/qt/qt673/qtbase
./configure: 18: exec: /home/topeet/qt/qt673/qtbase/configure: not found  可以确定文件是有的

如果你确定 configure 文件确实存在,但仍然遇到“not found”错误,这可能是由于以下几个原因之一导致的:

可能原因和解决方法

  1. 文件权限问题

    • 即使文件存在,如果它没有执行权限,系统也会无法执行它。确保 configure 脚本具有执行权限。
     

    chmod +x ./configure

    然后再次尝试运行:

     

    ./configure -prefix $PWD/qtbase

    文件路径问题

    • 确保当前工作目录是正确的,并且 configure 脚本确实位于该目录中。可以使用 pwd 查看当前目录,并使用 ls 确认 configure 脚本的存在。
     

    pwd
    ls -l ./configure

  2. 文件系统问题

    • 检查文件系统是否存在问题,例如挂载错误或文件系统损坏,这可能导致文件无法访问。可以尝试在其他终端中访问该文件,或者重启系统后重试。
  3. 脚本逻辑错误

    • 检查 configure 脚本的内容,确保没有逻辑错误导致它尝试执行错误的路径。查看脚本的前几行,确认它们是否正确地指向自身或其他可执行文件。
  4. Shell 环境问题

    • 确保使用的 shell(例如 bash)没有问题,或者环境变量没有被意外修改。可以尝试启动一个新的终端会话,或者在其他用户环境中执行脚本。
  5. 手动执行脚本

    • 进入 qtbase 目录后,手动执行 configure 脚本,观察是否有不同的错误信息。

    cd qtbase
    ./configure -prefix /home/topeet/qt/qt673/qtbase

进一步排查

  • 使用绝对路径:尝试使用配置脚本的绝对路径来执行它,以避免路径问题。

    /home/topeet/qt/qt673/configure -prefix $PWD/qtbase

  • 检查脚本内容:打开 configure 脚本,查看前几行,确认它是否在尝试执行另一个文件,并确保路径正确。

通过这些方法,你应该能够找到并修复导致 configure 脚本无法执行的问题。如果问题仍然存在,建议详细检查脚本的内容和逻辑,或者在 Qt 的支持论坛和社区中寻找类似问题的解决方案。

11.cmake --build . 

使用 cmake --build . 命令是在当前目录下构建项目的常见方法,尤其是在使用 CMake 作为构建系统时。这个命令会调用生成的构建系统(如 Makefile 或 Ninja)来编译和链接项目。以下是一些有关该命令的基本信息和使用建议:

前提条件

  1. CMake 构建文件:在运行 cmake --build . 之前,你需要确保已经在项目目录中运行过 cmake 命令来生成构建文件。通常的步骤是:

    mkdir build
    cd build
    cmake ..

    这样会在 build 目录中生成必要的构建文件。

  2. 构建工具:确保你的系统上安装了 CMake 支持的构建工具,例如 make 或 ninja。CMake 会根据系统设置或配置选择默认的构建工具。

使用方法

  • 基本构建

    cmake --build .

    这个命令会在当前目录下执行构建。如果你是在 build 目录中执行的,那么它会编译和链接项目中的所有目标。

  • 指定目标

    你可以指定特定的构建目标来构建。例如,如果你只想构建一个特定的可执行文件或库,可以这样做:

    cmake --build . --target MyTarget

    将 MyTarget 替换为你想要构建的目标名称。

  • 并行构建

    如果你想利用多核 CPU 的优势来加速构建过程,可以使用 -j 选项来指定并行构建。例如,使用 4 个线程进行并行构建:

    cmake --build . -j4

常见问题和解决方案

  1. 构建文件丢失
    • 如果看到错误信息提示找不到构建文件,确保你已经运行过 cmake 命令来生成这些文件。
  2. 构建工具未安装
    • 确保你的系统上安装了必要的构建工具(如 make 或 ninja)。在大多数 Linux 发行版上,你可以使用包管理器来安装这些工具。例如,在 Ubuntu 上:

      sudo apt-get install build-essential

  3. 权限问题
    • 如果遇到权限问题,确保你有权限在当前目录下写入和执行文件。
  4. 查看构建日志
    • 如果构建失败,仔细查看构建输出日志,寻找错误信息以定位问题。

通过使用 cmake --build . 命令,你可以方便地构建基于 CMake 的项目。如果你对构建过程有特定的需求或遇到问题,可以查看 CMake 的官方文档或在相关开发社区中寻求帮助。

12.

ERROR: Feature "xcb": Forcing to "ON" breaks its condition: QT_FEATURE_thread AND TARGET XCB::XCB AND TEST_xcb_syslibs AND QT_FEATURE_xk

这个错误信息表明在配置 Qt 项目时,CMake 尝试强制启用 "xcb" 特性,但该特性的某些条件未满足。以下是一些可能的解决方案,可以帮助你解决这个问题:

  1. 检查依赖项
    • 确保你已经安装了所有与 XCB 相关的库和开发包。这通常包括 libxcb1-devlibxcb-glx0-devlibxcb-xkb-devlibxcb-icccm4-devlibxcb-image0-devlibxcb-shm0-devlibxcb-keysyms1-devlibxcb-randr0-devlibxcb-render-util0-devlibxcb-shape0-devlibxcb-sync-devlibxcb-xfixes0-devlibxcb-xinerama0-devlibxcb-xinput-dev 等,具体取决于你的项目需求。
    • 在基于 Debian 的系统上,你可以使用 sudo apt-get install 来安装这些包。例如:

      sudo apt-get install libxcb1-dev libxcb-glx0-dev libxcb-xkb-dev

  2. 检查 CMake 配置
    • 确保 CMake 配置中没有错误地强制启用 "xcb" 特性。你可以在 CMake 命令行中明确地禁用它,如果你的项目不需要这个特性:
       

      cmake -DFEATURE_xcb=OFF ..

    • 如果你不确定如何配置这些选项,可以查看项目的文档或 CMakeLists.txt 文件,了解哪些特性是必需的。
  3. 确保其他依赖项满足
    • 错误信息中提到了 QT_FEATURE_thread 和 QT_FEATURE_xkb,确保这些特性所需的依赖项也已安装并正确配置。
    • 确保你的 Qt 安装是完整的,并且包含所有需要的模块和特性。
  4. 清理并重新配置
    • 删除构建目录中的所有内容,然后重新运行 CMake 命令。这可以确保没有旧的配置文件影响当前的配置过程。

      rm -rf *
      cmake ..
  5. 查看 Qt 和 CMake 的版本兼容性
    • 确保你使用的 Qt 和 CMake 版本是兼容的。有时候,较新的 Qt 版本可能需要较新版本的 CMake。
  6. 检查环境变量
    • 确保与 Qt 和 XCB 相关的环境变量(如 QTDIRPATHPKG_CONFIG_PATH 等)已正确设置。

如果这些步骤无法解决问题,可以查看项目的文档或寻求社区支持,以获取更多特定于项目的帮助。

 12.

Performing C++ SOURCE FILE Test HAVE_opensslv11_headers failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_f4242 && [1/2] Building CXX object CMakeFiles/cmTC_f4242.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_f4242.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_opensslv11_headers  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_f4242.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:4:4: error: #error OpenSSL >= 1.1.1 is required
    4 | #  error OpenSSL >= 1.1.1 is required
      |    ^~~~~
ninja: build stopped: subcommand failed.


Source file was:
 #include <openssl/ssl.h>
#include <openssl/opensslv.h>
#if !defined(OPENSSL_VERSION_NUMBER) || defined(OPENSSL_VERSION_MAJOR) || OPENSSL_VERSION_NUMBER-0 < 0x10101000L
#  error OpenSSL >= 1.1.1 is required
#endif
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
#  error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif

int main(void)
{
    /* BEGIN TEST: */
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_opensslv11 failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_384cd && [1/2] Building CXX object CMakeFiles/cmTC_384cd.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_384cd.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_opensslv11  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_384cd.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:4:4: error: #error OpenSSL >= 1.1.1 is required
    4 | #  error OpenSSL >= 1.1.1 is required
      |    ^~~~~
ninja: build stopped: subcommand failed.


Source file was:
 #include <openssl/ssl.h>
#include <openssl/opensslv.h>
#if !defined(OPENSSL_VERSION_NUMBER) || defined(OPENSSL_VERSION_MAJOR) || OPENSSL_VERSION_NUMBER-0 < 0x10101000L
#  error OpenSSL >= 1.1.1 is required
#endif
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
#  error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
#endif

int main(void)
{
    /* BEGIN TEST: */
SSL_free(SSL_new(0));
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test TEST_use_lld_linker failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_cfdce && [1/2] Building CXX object CMakeFiles/cmTC_cfdce.dir/src.cxx.o
[2/2] Linking CXX executable cmTC_cfdce
FAILED: cmTC_cfdce 
: && /usr/bin/c++  -fuse-ld=lld CMakeFiles/cmTC_cfdce.dir/src.cxx.o -o cmTC_cfdce   && :
collect2: fatal error: cannot find ‘ld’
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test TEST_gdb_index failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_badb0 && [1/2] Building CXX object CMakeFiles/cmTC_badb0.dir/src.cxx.o
[2/2] Linking CXX executable cmTC_badb0
FAILED: cmTC_badb0 
: && /usr/bin/c++  -Wl,--gdb-index CMakeFiles/cmTC_badb0.dir/src.cxx.o -o cmTC_badb0   && :
/usr/bin/ld:无法识别的选项‘--gdb-index’
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.


Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test HAVE_reduce_relocations failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_74bdf && [1/2] Building CXX object CMakeFiles/cmTC_74bdf.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_74bdf.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_reduce_relocations  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_74bdf.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:2:4: error: #error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
    2 | #  error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
      |    ^~~~~
ninja: build stopped: subcommand failed.


Source file was:
 #if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64)) || defined(__sun)
#  error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
#endif

int main(void)
{
    /* BEGIN TEST: */
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_alloca_malloc_h failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_3d1de && [1/2] Building CXX object CMakeFiles/cmTC_3d1de.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_3d1de.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_alloca_malloc_h  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_3d1de.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx: In function ‘int main()’:
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:6:1: error: ‘alloca’ was not declared in this scope; did you mean ‘valloc’?
    6 | alloca(1);
      | ^~~~~~
      | valloc
ninja: build stopped: subcommand failed.


Source file was:
 #include <malloc.h>

int main(void)
{
    /* BEGIN TEST: */
alloca(1);
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_intelcet failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_d4f5a && [1/2] Building CXX object CMakeFiles/cmTC_d4f5a.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_d4f5a.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_intelcet  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_d4f5a.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:5:4: error: #error Intel CET not available
    5 | #  error Intel CET not available
      |    ^~~~~
ninja: build stopped: subcommand failed.


Source file was:
 int main(void)
{
    /* BEGIN TEST: */
#if !defined(__CET__)
#  error Intel CET not available
#endif
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_pollts failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_37b47 && [1/2] Building CXX object CMakeFiles/cmTC_37b47.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_37b47.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_pollts  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_37b47.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx: In function ‘int main()’:
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:11:1: error: ‘pollts’ was not declared in this scope; did you mean ‘pollfd’?
   11 | pollts(&pfd, 1, &ts, &sig);
      | ^~~~~~
      | pollfd
ninja: build stopped: subcommand failed.


Source file was:
 #include <poll.h>
#include <signal.h>
#include <time.h>

int main(void)
{
    /* BEGIN TEST: */
struct pollfd pfd;
struct timespec ts;
sigset_t sig;
pollts(&pfd, 1, &ts, &sig);
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_cpp_winrt failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_90079 && [1/2] Building CXX object CMakeFiles/cmTC_90079.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_90079.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_cpp_winrt  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_90079.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:2:13: fatal error: winrt/base.h: 没有那个文件或目录
    2 | #   include <winrt/base.h>
      |             ^~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 // Including winrt/base.h causes an error in some configurations (Windows 10 SDK + c++20)
#   include <winrt/base.h>

int main(void)
{
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_res_setservers failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_4c90c && [1/2] Building CXX object CMakeFiles/cmTC_4c90c.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_4c90c.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_res_setservers  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_4c90c.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx: In function ‘int main()’:
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:6:30: error: aggregate ‘main()::res_sockaddr_union sa’ has incomplete type and cannot be defined
    6 |     union res_sockaddr_union sa;
      |                              ^~
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:8:5: error: ‘res_setservers’ was not declared in this scope; did you mean ‘res_isourserver’?
    8 |     res_setservers(s, &sa, 1);
      |     ^~~~~~~~~~~~~~
      |     res_isourserver
ninja: build stopped: subcommand failed.


Source file was:
 #include <sys/types.h>
#include <netinet/in.h>
#include <resolv.h>
int main()
{
    union res_sockaddr_union sa;
    res_state s = nullptr;
    res_setservers(s, &sa, 1);
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_sctp failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_33054 && [1/2] Building CXX object CMakeFiles/cmTC_33054.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_33054.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_sctp  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_33054.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:4:10: fatal error: netinet/sctp.h: 没有那个文件或目录
    4 | #include <netinet/sctp.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>

int main(void)
{
    /* BEGIN TEST: */
sctp_initmsg sctpInitMsg;
socklen_t sctpInitMsgSize = sizeof(sctpInitMsg);
(void) socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);
(void) getsockopt(-1, SOL_SCTP, SCTP_INITMSG, &sctpInitMsg, &sctpInitMsgSize);
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_networklistmanager failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_36742 && [1/2] Building CXX object CMakeFiles/cmTC_36742.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_36742.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_networklistmanager  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_36742.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:1:11: fatal error: netlistmgr.h: 没有那个文件或目录
    1 |  #include <netlistmgr.h>
      |           ^~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <netlistmgr.h>
#include <ocidl.h>
#include <wrl/client.h>

int main(void)
{
    /* BEGIN TEST: */
using namespace Microsoft::WRL;
ComPtr<INetworkListManager> networkListManager;
ComPtr<IConnectionPoint> connectionPoint;
ComPtr<IConnectionPointContainer> connectionPointContainer;
networkListManager.As(&connectionPointContainer);
connectionPointContainer->FindConnectionPoint(IID_INetworkConnectionEvents, &connectionPoint);
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_egl_brcm failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_84635 && [1/2] Building CXX object CMakeFiles/cmTC_84635.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_84635.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_egl_brcm  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_84635.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:2:10: fatal error: bcm_host.h: 没有那个文件或目录
    2 | #include <bcm_host.h>
      |          ^~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <EGL/egl.h>
#include <bcm_host.h>

int main(void)
{
    /* BEGIN TEST: */
vc_dispmanx_display_open(0);
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_egl_mali failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_73c0f && [1/2] Building CXX object CMakeFiles/cmTC_73c0f.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_73c0f.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_egl_mali  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_73c0f.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:1:11: fatal error: EGL/fbdev_window.h: 没有那个文件或目录
    1 |  #include <EGL/fbdev_window.h>
      |           ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <EGL/fbdev_window.h>
#include <EGL/egl.h>
#include <GLES2/gl2.h>

int main(void)
{
    /* BEGIN TEST: */
fbdev_window *w = 0;
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_egl_mali_2 failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_605ef && [1/2] Building CXX object CMakeFiles/cmTC_605ef.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_605ef.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_egl_mali_2  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_605ef.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx: In function ‘int main()’:
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:7:1: error: ‘mali_native_window’ was not declared in this scope
    7 | mali_native_window *w = 0;
      | ^~~~~~~~~~~~~~~~~~
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:7:21: error: ‘w’ was not declared in this scope
    7 | mali_native_window *w = 0;
      |                     ^
ninja: build stopped: subcommand failed.


Source file was:
 #include <EGL/egl.h>
#include <GLES2/gl2.h>

int main(void)
{
    /* BEGIN TEST: */
mali_native_window *w = 0;
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_egl_viv failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_ad98e && [1/2] Building CXX object CMakeFiles/cmTC_ad98e.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_ad98e.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_egl_viv  -DEGL_API_FB=1 -fPIE -std=gnu++17 -o CMakeFiles/cmTC_ad98e.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:2:10: fatal error: EGL/eglvivante.h: 没有那个文件或目录
    2 | #include <EGL/eglvivante.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <EGL/egl.h>
#include <EGL/eglvivante.h>

int main(void)
{
    /* BEGIN TEST: */
#ifdef __INTEGRITY
fbGetDisplay();
#else
// Do not rely on fbGetDisplay(), since the signature has changed over time.
// Stick to fbGetDisplayByIndex().
fbGetDisplayByIndex(0);
#endif
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_egl_openwfd failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_d639f && [1/2] Building CXX object CMakeFiles/cmTC_d639f.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_d639f.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_egl_openwfd  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_d639f.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:1:11: fatal error: wfd.h: 没有那个文件或目录
    1 |  #include <wfd.h>
      |           ^~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <wfd.h>

int main(void)
{
    /* BEGIN TEST: */
wfdEnumerateDevices(nullptr, 0, nullptr);
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_egl_rcar failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_84013 && [1/2] Building CXX object CMakeFiles/cmTC_84013.dir/src.cxx.o
[2/2] Linking CXX executable cmTC_84013
FAILED: cmTC_84013 
: && /usr/bin/c++   CMakeFiles/cmTC_84013.dir/src.cxx.o -o cmTC_84013  /usr/lib/aarch64-linux-gnu/libEGL.so  /usr/lib/aarch64-linux-gnu/libGLESv2.so  /usr/lib/aarch64-linux-gnu/libEGL.so && :
/usr/bin/ld: CMakeFiles/cmTC_84013.dir/src.cxx.o: in function `main':
src.cxx:(.text+0x8): undefined reference to `PVRGrfxServerInit'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.


Source file was:
 #include <EGL/egl.h>
extern "C" {
extern unsigned long PVRGrfxServerInit(void);
}

int main(void)
{
    /* BEGIN TEST: */
PVRGrfxServerInit();
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_integrityfb failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_af4a6 && [1/2] Building CXX object CMakeFiles/cmTC_af4a6.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_af4a6.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_integrityfb  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_af4a6.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:1:11: fatal error: device/fbdriver.h: 没有那个文件或目录
    1 |  #include <device/fbdriver.h>
      |           ^~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <device/fbdriver.h>

int main(void)
{
    /* BEGIN TEST: */
FBDriver *driver = 0;
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_directwrite failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_2b393 && [1/2] Building CXX object CMakeFiles/cmTC_2b393.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_2b393.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_directwrite  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_2b393.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:1:11: fatal error: dwrite_2.h: 没有那个文件或目录
    1 |  #include <dwrite_2.h>
      |           ^~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <dwrite_2.h>
int main(int, char **)
{
    IUnknown *factory = nullptr;
    DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),
                        &factory);
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_directwrite3 failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_7fb1a && [1/2] Building CXX object CMakeFiles/cmTC_7fb1a.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_7fb1a.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_directwrite3  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_7fb1a.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:1:11: fatal error: dwrite_3.h: 没有那个文件或目录
    1 |  #include <dwrite_3.h>
      |           ^~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <dwrite_3.h>
int main(int, char **)
{
    IUnknown *factory = nullptr;
    DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory3),
                        &factory);
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_d2d1 failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_f8f66 && [1/2] Building CXX object CMakeFiles/cmTC_f8f66.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_f8f66.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_d2d1  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_f8f66.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:1:11: fatal error: d2d1.h: 没有那个文件或目录
    1 |  #include <d2d1.h>
      |           ^~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <d2d1.h>
int main(int, char **)
{
    void *factory = nullptr;
    D2D1_FACTORY_OPTIONS options;
    ZeroMemory(&options, sizeof(D2D1_FACTORY_OPTIONS));
    D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, GUID{}, &options, &factory);
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_d2d1_1 failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_06876 && [1/2] Building CXX object CMakeFiles/cmTC_06876.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_06876.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_d2d1_1  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_06876.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:1:11: fatal error: d2d1_1.h: 没有那个文件或目录
    1 |  #include <d2d1_1.h>
      |           ^~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #include <d2d1_1.h>
int main(int, char **)
{
    ID2D1Factory1 *d2dFactory;
    D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &d2dFactory);
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_arm_thumb failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_571c4 && [1/2] Building CXX object CMakeFiles/cmTC_571c4.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_571c4.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_arm_thumb  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_571c4.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:16:6: error: #error "fail"
   16 | #    error "fail"
      |      ^~~~~
ninja: build stopped: subcommand failed.


Source file was:
 


int main(int argc, char **argv)
{
    (void)argc; (void)argv;
    /* BEGIN TEST: */
#if defined(thumb2) || defined(__thumb2__)
#    define THUMB_OK
#elif (defined(__thumb) || defined(__thumb__)) && __TARGET_ARCH_THUMB-0 == 4
#    define THUMB_OK
#elif defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB == 2
// clang 3.5 and later will set this if the core supports the Thumb-2 ISA.
#    define THUMB_OK
#else
#    error "fail"
#endif
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_ntddmodm failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_e4023 && [1/2] Building CXX object CMakeFiles/cmTC_e4023.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_e4023.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_ntddmodm  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_e4023.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:2:10: fatal error: windows.h: 没有那个文件或目录
    2 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 
#include <windows.h>
#include <ntddmodm.h>

int main(int argc, char **argv)
{
    (void)argc; (void)argv;
    /* BEGIN TEST: */
GUID guid = GUID_DEVINTERFACE_MODEM;
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_libhybris_egl_server failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_702d7 && [1/2] Building CXX object CMakeFiles/cmTC_702d7.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_702d7.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_libhybris_egl_server  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_702d7.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:4:10: fatal error: hybris/eglplatformcommon/hybris_nativebufferext.h: 没有那个文件或目录
    4 | #include <hybris/eglplatformcommon/hybris_nativebufferext.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <hybris/eglplatformcommon/hybris_nativebufferext.h>

int main(int argc, char **argv)
{
    (void)argc; (void)argv;
    /* BEGIN TEST: */
#ifdef EGL_HYBRIS_native_buffer
return 0;
#else
#error Requires EGL_HYBRIS_native_buffer to be defined
return 1;
#endif
    /* END TEST: */
    return 0;
}

Performing C++ SOURCE FILE Test HAVE_vulkan_server_buffer failed with the following output:
Change Dir: /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_177da && [1/2] Building CXX object CMakeFiles/cmTC_177da.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_177da.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_vulkan_server_buffer  -fPIE -std=gnu++17 -o CMakeFiles/cmTC_177da.dir/src.cxx.o -c /home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx
/home/topeet/qt-insert/q672/CMakeFiles/CMakeTmp/src.cxx:2:10: fatal error: vulkan/vulkan.h: 没有那个文件或目录
    2 | #include <vulkan/vulkan.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Source file was:
 #define VK_USE_PLATFORM_WAYLAND_KHR 1
#include <vulkan/vulkan.h>

int main(int argc, char **argv)
{
    (void)argc; (void)argv;
    /* BEGIN TEST: */
VkExportMemoryAllocateInfoKHR exportAllocInfo = {};
exportAllocInfo.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR;
exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
return 0;
    /* END TEST: */
    return 0;
}

这些错误信息表明在配置你的项目时,CMake 正在执行一系列 C++ 源文件测试,以确定你的系统是否支持特定的功能和库。以下是对每个测试失败的详细分析和可能的解决方案:

1. OpenSSL 1.1.1 及以上版本

错误信息

 

#error OpenSSL >= 1.1.1 is required

解决方案

  • 确保你的系统上安装了 OpenSSL 1.1.1 或更高版本。你可以使用包管理器来安装,例如在 Ubuntu 上:
     

    sudo apt-get install libssl-dev

  • 检查 opensslv.h 头文件,确保它定义的 OPENSSL_VERSION_NUMBER 至少为 0x10101000L

2. 使用 LLD 链接器

错误信息

 

collect2: fatal error: cannot find ‘ld’

解决方案

  • 确保 LLD 链接器已安装。在某些系统上,LLD 可能需要单独安装。
  • 如果你不需要 LLD,可以在 CMake 配置时禁用它:
     

    cmake -DUSE_LLD=OFF ..

3. GDB 索引支持

错误信息

 

/usr/bin/ld:无法识别的选项‘--gdb-index’

解决方案

  • 确保你的链接器支持 --gdb-index 选项。这通常与特定的调试器版本和链接器版本有关。
  • 如果不需要此功能,可以在 CMake 配置时禁用它:
     

    cmake -DENABLE_GDB_INDEX=OFF ..

4. 符号重定位问题

错误信息

 

#error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).

解决方案

  • 这个错误可能与特定的架构或编译器设置有关。检查你的编译器和架构是否支持符号重定位。
  • 如果问题持续存在,可能需要查阅 Qt 的相关文档或社区讨论。

5. alloca 函数

错误信息

error: ‘alloca’ was not declared in this scope; did you mean ‘valloc’?

解决方案

  • 确保包含 <cstdlib> 或 <alloca.h> 头文件,具体取决于你的编译器和标准库。
  • 如果不需要 alloca,可以考虑移除相关代码或条件编译。

6. Intel CET

错误信息

#error Intel CET not available

解决方案

  • Intel CET(Control-flow Enforcement Technology)是一个硬件特性,需要 CPU 支持。检查你的 CPU 是否支持 Intel CET。
  • 如果不需要此特性,可以在 CMake 配置时禁用它:

    cmake -DENABLE_INTEL_CET=OFF ..

7. 其他头文件和库缺失

对于其他头文件(如 winrt/base.hnetlistmgr.h 等)和库(如 libEGLlibGLESv2 等)的缺失错误:

解决方案

  • 确保相关的开发包已安装。这些通常可以通过包管理器安装。
  • 如果某些功能或库在你的平台上不可用,考虑在 CMake 配置时禁用它们。

总结

这些错误通常是由于缺少必要的库、头文件或特定硬件支持。确保你的开发环境配置正确,并安装所有必要的依赖项。如果某些功能在你的平台上不可用,考虑在 CMake 配置时禁用它们。如果问题仍然存在,可能需要查阅项目的文档或寻求社区帮助。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值