Skip to content
Download

Common problems

The blue “Windows protected your PC” screen shows up because Brasa doesn’t have a digital signature yet. Click More info and then Run anyway. Always download from the Download page.

Play doesn’t compile: “CMake não encontrado”

Section titled “Play doesn’t compile: “CMake não encontrado””

The Saída (Output) shows CMake não encontrado (CMake not found) and the status bar shows CMake ausente (CMake missing). This happens when the Visual Studio Build Tools weren’t installed, for example if you clicked Instalar sem (install without) in the installer.

To fix it, choose one:

  • Run the Brasa installer again and, at the build tools step, click Baixar e instalar o Build Tools (download and install the Build Tools).
  • Install the Build Tools by hand, from Microsoft’s site, checking the workload Desktop development with C++ and the component C++ CMake tools for Windows.

Then close and open Brasa. If CMake is in a place other than the default, enter the path in Projeto › Preferências… › Caminho do CMake (Project › Preferences › CMake path).

The Saída shows a line like Player.cpp(23,5): error .... Click it to open the file at the line of the error. The most common messages are in Reading compiler errors.

Also check:

  • Each object has BRASA_ENTITY(Name); with the same name as the object in the editor.
  • The object’s .cpp starts with the #include of its .hpp, for example #include "Player.hpp".
  • The class wasn’t left declared twice: it lives only in the object’s .hpp.
  • Is the instance in the room that opens first? The start room shows up as (inicial) in Recursos (Resources).
  • Does the object have a sprite? Objects without a sprite draw nothing (unless you draw in onRender).
  • Is the instance inside the area of the room and of the camera?
  • Wasn’t visible left as false?

Normally Play redoes the build from scratch by itself after an update. If it still doesn’t compile, delete the project’s .brasa/ folder and press Play: nothing from your project is lost. See SDK and build.

  • Is the file a WAV, OGG or MP3? Other formats don’t work.
  • The name in the code is the name of the file without the .wav, with the same upper and lower case: Audio::play("explosao") for explosao.wav.
  • Click the ▶ next to the sound in Recursos: if it doesn’t play there, the problem is the file.

drawText only draws letters without accents (ASCII). Write PONTUACAO instead of PONTUAÇÃO.

If two shots hit the same enemy on the same step, both onCollide run. Check isDestroyed() before scoring, as in the tutorial.

Write to the Saída with brasa::logInfo:

#include <format> // at the top of the file
brasa::logInfo(std::format("vidas = {}", state().lives));