Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Variable QMAKE_CXX.COMPILER_MACROS is not defined.
Forum Updated to NodeBB v4.3 + New Features

Variable QMAKE_CXX.COMPILER_MACROS is not defined.

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 2 Posters 529 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OrazioArcidiacono
    wrote on last edited by
    #1

    Hello, I'm creating a docker/container with the following docker file. But when I try to do qmake in a simple project I have this error

    root@99782fdb152a:/workspace/simple-qt-project# qmake
    /opt/Qt/mkspecs/features/toolchain.prf:76: Variable QMAKE_CXX.COMPILER_MACROS is not defined.
    Project ERROR: failed to parse default include paths from compiler output

    Can you help me?

    # Fase 1: Ambiente ARM64
    FROM debian:bookworm-slim AS arm64-environment
    
    # Aggiungi informazioni di manutenzione
    LABEL maintainer="xx@xx.it"
    
    # Configura i repository ARM64 e strumenti di base
    RUN dpkg --add-architecture arm64 && \
        apt-get update && apt-get install -y --no-install-recommends \
        apt-transport-https ca-certificates gnupg2 wget nano file locales && \
        echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen && \
        apt-get clean && rm -rf /var/lib/apt/lists/*
    
    # Configura la locale UTF-8
    ENV LANG=en_US.UTF-8 \
        LC_ALL=en_US.UTF-8
    
    # Fase 2: Librerie ARM64 con messaggi di errore stampati e log
    FROM arm64-environment AS libraries
    
    # Definisce un file di log per output e errori
    RUN touch /var/log/libraries-install.log
    
    # Installazione delle librerie con registrazione e messaggi
    RUN apt-get update >> /var/log/libraries-install.log 2>&1 && \
        (apt-get install -y --no-install-recommends \
        g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libc6-dev:arm64 libstdc++6:arm64 libgcc-s1:arm64 || \
        (echo "Errore: g++, gcc, libc6-dev non trovati" && echo "Errore: g++, gcc, libc6-dev non trovati" >> /var/log/libraries-install.log)) && \
        (apt-get install -y --no-install-recommends \
        cmake ninja-build || \
        (echo "Errore: cmake, ninja-build non trovati" && echo "Errore: cmake, ninja-build non trovati" >> /var/log/libraries-install.log)) && \
        (apt-get install -y --no-install-recommends \
        libgles2-mesa-dev:arm64 libegl1-mesa-dev:arm64 libgl1-mesa-dev:arm64 libxcb1-dev:arm64 libx11-dev:arm64 || \
        (echo "Errore: OpenGL/X11 non trovati" && echo "Errore: OpenGL/X11 non trovati" >> /var/log/libraries-install.log)) && \
        (apt-get install -y --no-install-recommends \
        libfontconfig1-dev:arm64 libfreetype6-dev:arm64 mesa-common-dev:arm64 meson:arm64 libclang-dev:arm64 || \
        (echo "Errore: fontconfig/clang non trovati" && echo "Errore: fontconfig/clang non trovati" >> /var/log/libraries-install.log)) && \
        (apt-get install -y --no-install-recommends \
        libpulse-dev:arm64 libasound2-dev:arm64 libgstreamer1.0-dev:arm64 libgstreamer-plugins-base1.0-dev:arm64 || \
        (echo "Errore: Pulse/GStreamer non trovati" && echo "Errore: Pulse/GStreamer non trovati" >> /var/log/libraries-install.log)) && \
        (apt-get install -y --no-install-recommends \
        libwebp-dev:arm64 libbluetooth-dev:arm64 libxext-dev:arm64 libxfixes-dev:arm64 libxi-dev:arm64 || \
        (echo "Errore: WebP/Bluetooth/X11 Ext non trovati" && echo "Errore: WebP/Bluetooth/X11 Ext non trovati" >> /var/log/libraries-install.log)) && \
        (apt-get install -y --no-install-recommends \
        libxrender-dev:arm64 python3-dev python3-html5lib gperf bison flex libnss3-dev:arm64 || \
        (echo "Errore: strumenti di sviluppo non trovati" && echo "Errore: strumenti di sviluppo non trovati" >> /var/log/libraries-install.log)) && \
        (apt-get install -y --no-install-recommends \
        libxshmfence-dev:arm64 libcups2-dev:arm64 libx264-dev libx265-dev libvorbis-dev || \
        (echo "Errore: multimedia non trovati" && echo "Errore: multimedia non trovati" >> /var/log/libraries-install.log)) && \
        apt-get clean >> /var/log/libraries-install.log 2>&1 && rm -rf /var/lib/apt/lists/*
    
    # Fase 3: Compilazione di Qt
    FROM libraries AS qt-build
    
    # Crea una directory di lavoro
    WORKDIR /workspace
    
    # Scarica e prepara i sorgenti di Qt
    RUN wget https://download.qt.io/official_releases/qt/6.8/6.8.1/single/qt-everywhere-src-6.8.1.tar.xz && \
        tar -xf qt-everywhere-src-6.8.1.tar.xz -C /workspace && \
        rm qt-everywhere-src-6.8.1.tar.xz
    
    # Configura il sistema di build di Qt con CMake
    WORKDIR /workspace/build-qt
    RUN cmake -G Ninja \
        -DCMAKE_INSTALL_PREFIX=/opt/Qt \
        -DQT_QMAKE_TARGET_MKSPEC=devices/linux-rasp-pi3-vc4-g++ \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc \
        -DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++ \
        -DCMAKE_CXX_FLAGS="-march=armv8-a -mtune=cortex-a53" \
        -DCMAKE_C_FLAGS="-march=armv8-a -mtune=cortex-a53" \
        -DFEATURE_linguisttools=OFF \
        -DBUILD_qttranslations=OFF \
        -DFEATURE_webengine=OFF \
        -DFEATURE_pdf=OFF \
        -DFEATURE_quick3d=OFF \
        -DFEATURE_quick3dphysics=OFF \
        -DFEATURE_docs=OFF \
        -DFEATURE_graphs=OFF \
        -DFEATURE_printsupport=OFF\
        -DBUILD_qttools=OFF
        -DQT_BUILD_EXAMPLES=OFF \
        -DQT_BUILD_TESTS=OFF \
        ../qt-everywhere-src-6.8.1
    
    
    # Salva l'immagine dopo la configurazione CMake
    FROM qt-build AS qt-configured
    
    # Compila e installa Qt
    RUN ninja && ninja install
    
    # Rimuovi i file di build per ridurre le dimensioni
    RUN rm -rf /workspace/build-qt /workspace/qt-everywhere-src-6.8.1
    
    # Fase 4: Immagine finale
    FROM debian:bookworm-slim
    
    # Copia i binari di Qt dall'immagine di build
    COPY --from=qt-build /opt/Qt /opt/Qt
    COPY --from=libraries /var/log/libraries-install.log /var/log/libraries-install.log
    
    # Aggiungi Qt al PATH
    ENV PATH="/opt/Qt/bin:$PATH"
    
    # Imposta la directory di lavoro predefinita
    WORKDIR /workspace
    
    # Esegui il container con una shell di default
    CMD ["bash"]
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      From the looks of it, in your final stage, you forgot to install the compiler and other tools required to do development.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      O 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        From the looks of it, in your final stage, you forgot to install the compiler and other tools required to do development.

        O Offline
        O Offline
        OrazioArcidiacono
        wrote on last edited by
        #3

        @SGaist
        Can you try to be more precise please?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          For the last stage you start from bookworm-slim and only copy the Qt build and a log file.
          Thus you have a bare bone system with no compiler, no developer helper tools such as make, etc.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved