VCV Rack debug mode error: resource directory does not exist on Mac

Hey! When I’m running VCV Rack normally its all fine, however when I am trying to run it in debug mode using ./Rack -d I get the error message:

Rack's resource directory "/Applications/VCV Rack 2 Free.app/Contents/MacOS/res" does not exist. Make sure Rack is correctly installed and launched.

When I do lldb ./Rack followed by run -d I get:

Process 89101 launched: '/Applications/VCV Rack 2 Free.app/Contents/MacOS/Rack' (x86_64)
[0.000 info adapters/standalone.cpp:152 main] VCV Rack Free 2.2.3 macOS x64
[0.000 info adapters/standalone.cpp:153 main] Mac 12.3
[0.000 info adapters/standalone.cpp:159 main] Args: /Applications/VCV Rack 2 Free.app/Contents/MacOS/Rack -d 
[0.000 info adapters/standalone.cpp:161 main] Development mode
[0.000 info adapters/standalone.cpp:162 main] System directory: /Applications/VCV Rack 2 Free.app/Contents/MacOS
[0.000 info adapters/standalone.cpp:163 main] User directory: /Applications/VCV Rack 2 Free.app/Contents/MacOS
[0.000 info adapters/standalone.cpp:165 main] Bundle path: 
[0.001 info adapters/standalone.cpp:167 main] System time: 2023-02-16 22:58:20 +0100
[0.001 info src/settings.cpp:501 load] Loading settings /Applications/VCV Rack 2 Free.app/Contents/MacOS/settings.json

Interestingly when I give it its system and user folder:

./Rack -s ../Resources -u ~/Documents/Rack2/ -d

it will run but none of the plugins work and I get the following debug messages for each of them:

Could not load plugin /Users/nls/Documents/Rack2/plugins/Bogaudio: Failed to load library /Users/nls/Documents/Rack2/plugins/Bogaudio/plugin.dylib: dlopen(/Users/nls/Documents/Rack2/plugins/Bogaudio/plugin.dylib, 0x0006): Library not loaded: /tmp/Rack2/libRack.dylib
  Referenced from: /Users/nls/Documents/Rack2/plugins/Bogaudio/plugin.dylib
  Reason: tried: '/tmp/Rack2/libRack.dylib' (no such file), '/usr/local/lib/libRack.dylib' (no such file), '/usr/lib/libRack.dylib' (no such file)

Can any of you spot whats gone wrong here?

I only have an idea of the second one. I’m on macOS 10.12.6, and a while ago in another thread it came up that Rack makes a symbolic link /tmp/Rack2/libRack.dylib when it starts. Some others had that link on their machines but I don’t, like you don’t either. I never run Rack from the command line though and my Rack otherwise runs just fine.

I think i found the thread you’re referring to. So I did what you did and tried:

install_name_tool -change libRack.dylib "/Applications/VCV Rack 2 Free.app/Contents/Resources/libRack.dylib" path/to/my/module/plugin.dylib

But the same error still persists. Another thing I tried was to copy libRack.dylib to /usr/local/lib/ just to see if that fixes anything and initial error disappears but now it crashes when trying to load the preview to any plugin.

[4.462 info src/app/Browser.cpp:200 createPreview] Creating module widget np waveset-synth
2023-02-17 12:43:56.688008+0100 Rack[94794:1473125] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N4rack6widget6WidgetE, 19Waveset_synthWidget, N4rack3app10PortWidgetE.
2023-02-17 12:43:56.688025+0100 Rack[94794:1473125] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N4rack6widget6WidgetE, N4rack3app11PanelBorderE, N4rack3app10PortWidgetE.
2023-02-17 12:43:56.688034+0100 Rack[94794:1473125] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N4rack6widget6WidgetE, N4rack16componentlibrary11ScrewSilverE, N4rack3app10PortWidgetE.
2023-02-17 12:43:56.688041+0100 Rack[94794:1473125] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N4rack6widget6WidgetE, N4rack16componentlibrary11ScrewSilverE, N4rack3app10PortWidgetE.
2023-02-17 12:43:56.688066+0100 Rack[94794:1473125] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N4rack6widget6WidgetE, N4rack6widget15TransformWidgetE, N4rack3app10PortWidgetE.
2023-02-17 12:43:56.688081+0100 Rack[94794:1473125] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N4rack6widget6WidgetE, N4rack16componentlibrary11ScrewSilverE, N4rack3app10PortWidgetE.
2023-02-17 12:43:56.688093+0100 Rack[94794:1473125] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N4rack6widget6WidgetE, N4rack16componentlibrary14RoundBlackKnobE, N4rack3app10PortWidgetE.
Assertion failed: (threadContext), function contextGet, file context.cpp, line 51.
libRack.dylib was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 94794 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
    frame #4: 0x0000000119119ea1 libRack.dylib`rack::contextGet() (.cold.1) at context.cpp:51:2 [opt]
   48  	static thread_local Context* threadContext = NULL;
   49  	
   50  	Context* contextGet() {
-> 51  		assert(threadContext);
   52  		return threadContext;
   53  	}
   54  	
Target 0: (Rack) stopped.

Also building from source or reinstalling Rack doesn’t help. My overall goal is just to get some error and debugging messages when I’m running a custom plugin I’m building. Maybe there is another way?

Can you just use logging statements like this in your code?

    INFO("x = %d", x);
3 Likes

oh wow… I was driving myself crazy and totally missed that there’s a log.txt. Thank you!!

1 Like