Compiling errors on porting to V1


I m migrating to V1.0 and encounter some compiling problems.
I m on step 1.8. and try to compile a module that doesn’t use on* event or custom widgets using the SDK V1.0 on windows .

These erros are about widget struct declarations :


  1. error: ‘background’ was not declared in this scope

when declaring my widget struct like this

struct HexaJackPort : SVGPort {
	HexaJackPort() {
		background->svg = APP->window->loadSvg(asset::plugin(pluginInstance, "res/HexaJackPort.svg"));
		box.size = background->box.size;
  1. error : error: expected class-name before ‘{’

when declaring switch like this:

struct TR808BigButton : SVGSwitch, MomentarySwitch {
	TR808BigButton() {
		addFrame(APP->window->loadSvg (asset::plugin(pluginInstance,"res/TRBigButton.svg")));
		box.size = sw->box.size;

I’m using the rack0.hpp header and my make file looks like this

RACK_DIR ?= ../..
SOURCES = $(wildcard src/*.cpp) $(wildcard src/*.c)

DISTRIBUTABLES += $(wildcard LICENSE*) res

include $(RACK_DIR)/
include $(RACK_DIR)/


UP: Solved by using “momentary = true;”


setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, “res/HexaJackPort.svg”)));

for the jack,

I m going on the next step :slight_smile:

Just started typing an answer, but my suggestions matched what you figured out!

Thanks :slight_smile:

I am not a wiz with msys or cmake, so I apologize if this is basic. I am working on a fresh install of Rack with checkout v1. What does this mean, if you have a minute? Thanks very much!

`$ make -j8 dep
make -C dep
make[1]: Entering directory ‘/home/djpeter1/Rack.190519/dep’
mkdir -p .
cd rtaudio && mkdir -p build
CMake Error at CMakeLists.txt:2 (cmake_minimum_required):
CMake 3.10 or higher is required. You are running version 3.9.2

– Configuring incomplete, errors occurred!
make[1]: *** [Makefile:159: lib/librtaudio.a] Error 1
make[1]: Leaving directory ‘/home/djpeter1/Rack.190519/dep’
make: *** [Makefile:51: dep] Error 2

djpeter1@LASLW17040494 MINGW64 ~/Rack.190519
$ pacman -S cmake
warning: cmake-3.6.2-1 is up to date

Generally when posting build issues, post on GitHub, give your OS and version, and surround code with ``` on its own line.

In your case, I can make an educational guess though. Your MSYS2 packages are out of date, so run pacman -Syu.

1 Like

Thanks very much, Andew! I will work on it!

having the same issue. where did you put this “momentary = true” line?

In your custom widget’s constructor. See for examples.

thx I was looking at that fle and discovered i need to change MomentarySwitch to SvgSwitch