【问题标题】:Get project ERROR: Cannot run compiler 'g++'. Output:获取项目错误:无法运行编译器“g++”。输出:
【发布时间】:2020-12-27 03:49:29
【问题描述】:
Project ERROR: Cannot run compiler 'g++'. Output:
The system cannot find the path specified.
Project ERROR: Cannot run compiler 'g++'. Output:
===================
# 1 "C:/Qt/Qt5.15.2/5.15.2/mingw81_32/mkspecs/features/data/macros.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "C:/Qt/Qt5.15.2/5.15.2/mingw81_32/mkspecs/features/data/macros.cpp"
QT_COMPILER_STDCXX = 201402L
# 26 "C:/Qt/Qt5.15.2/5.15.2/mingw81_32/mkspecs/features/data/macros.cpp"
QMAKE_GCC_MAJOR_VERSION = 8
QMAKE_GCC_MINOR_VERSION = 1
QMAKE_GCC_PATCH_VERSION = 0
===================
Maybe you forgot to setup the environment?

对于 32 位和 64 位版本,以及全新安装后。

【问题讨论】:

    标签: c++ qt qt5 qmake


    【解决方案1】:

    原因可能是您的系统可能没有安装 g++ 或未设置 g++ 的路径。

    1. 检查 g++ 版本

    2. 如果找不到版本,则安装 g++ 编译器

    3. 将 PATH 变量设置为 g++ location 。在 linux 中,g++ 在路径中 - “/usr/bin/g++”

    4. 尝试在 qmake 文件中设置以下变量

      QMAKE_CC = gcc
      QMAKE_CXX = g++
      

    尝试通过命令行编译:

    qmake projectName.pro -r -spec linux-g++
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-11-12
      • 2015-11-03
      • 2020-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-26
      相关资源
      最近更新 更多