Hey guys, I’ve been looking at JUCE on and off for a few months and finally decided to try it for a program I’m planning atm. I’ll be implementing VST hosting so decided to start with the audio plugin host in the extras/ directory.
My main workstation runs Linux (Ubuntu 11.04 i686) and I’ve installed the libraries listed in this post. I downloaded the vstsdk2.4 and have set up my workspace like so:
workspace/libs/vstsdk2.4/ (vst_sdk2_4_rev2)
workspace/libs/juce/ (git clone from today)
and updated the Makefile of the audio plugin host example to match the above directory, relative to the Makefile:
$ pwd
/home/sherman/workspace/libs/juce/extras/audio plugin host/Builds/Linux/Makefile
$ sed -i -e 's@~/SDKs@../../../../..@' Makefile
$ grep vst Makefile # output actually appears twice (Debug, Release)
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" . . . -I "../../../../../vstsdk2.4" . . .
RESFLAGS := -D "LINUX=1" . . . -I "../../../../../vstsdk2.4" . . .
If you try to run make now, it will fail for what looks like the reason shown in this post.
$ make
Compiling FilterGraph.cpp
Compiling GraphEditorPanel.cpp
Compiling HostStartup.cpp
Compiling InternalFilters.cpp
Compiling MainHostWindow.cpp
Compiling JuceLibraryCode1.cpp
Compiling JuceLibraryCode2.cpp
In file included from ../../JuceLibraryCode/../../../amalgamation/../src/audio/plugin_host/formats/juce_VSTPluginFormat.mm:28:0,
from ../../JuceLibraryCode/../../../amalgamation/juce_amalgamated_template.cpp:216,
from ../../JuceLibraryCode/../../../amalgamation/juce_amalgamated2.cpp:32,
from ../../JuceLibraryCode/JuceLibraryCode2.cpp:15:
../../JuceLibraryCode/../../../amalgamation/../src/audio/plugin_host/formats/juce_VSTPluginFormat.cpp:1914:40: warning: multi-character character constant
(above warning repeated a few times on different lines)
In file included from ../../../../../vstsdk2.4/pluginterfaces/vst2.x/aeffectx.h:17:0,
from ../../JuceLibraryCode/../../../amalgamation/../src/audio/plugin_host/formats/juce_VSTPluginFormat.cpp:105,
from ../../JuceLibraryCode/../../../amalgamation/../src/audio/plugin_host/formats/juce_VSTPluginFormat.mm:28,
from ../../JuceLibraryCode/../../../amalgamation/juce_amalgamated_template.cpp:216,
from ../../JuceLibraryCode/../../../amalgamation/juce_amalgamated2.cpp:32,
from ../../JuceLibraryCode/JuceLibraryCode2.cpp:15:
../../../../../vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:125:32: error: expected ‘)’ before ‘*’ token
(above error repeated a few times on different lines)
../../../../../vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:149:2: error: ‘AEffectDispatcherProc’ does not name a type
(above error repeated a few times with the other types from the VSTCALLBACK typedefs in the same file)
with some additional errors following, due to the above.
The post mentioned above shows some changes to juce_VST_Wrapper.cpp, but this file isn’t referenced in the audio plugin host project, so __cdecl is never defined (that I can find). If I modify juce_VSTPluginFormat.cpp as shown:
[code]$ cat src/audio/plugin_host/formats/juce_VSTPluginFormat.cpp
#include “…/…/…/core/juce_TargetPlatform.h”
#include “…/…/…/…/juce_Config.h”
#if JUCE_PLUGINHOST_VST && (JUCE_MAC_VST_INCLUDED || ! JUCE_MAC)
#if JUCE_WINDOWS
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x500
#undef STRICT
#define STRICT 1
#include <windows.h>
#include <float.h>
#pragma warning (disable : 4312 4355)
#ifdef __INTEL_COMPILER
#pragma warning (disable : 1899)
#endif
#elif JUCE_LINUX
#define __cdecl // <- Added define here
#include <float.h>
#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#undef Font
#undef KeyPress
#undef Drawable
#undef Time
#else
#define Point CarbonDummyPointName // (workaround to avoid definition of “Point” by old Carbon headers)
#include <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
#undef Point
#endif
//==============================================================================
#include “…/…/…/core/juce_StandardHeader.h”
#if ! (JUCE_MAC && JUCE_64BIT)
BEGIN_JUCE_NAMESPACE [/code]
I can compile further and get the following errors:
$ make
Compiling FilterGraph.cpp
Compiling GraphEditorPanel.cpp
Compiling HostStartup.cpp
Compiling InternalFilters.cpp
Compiling MainHostWindow.cpp
Compiling JuceLibraryCode1.cpp
Compiling JuceLibraryCode2.cpp
In file included from ../../JuceLibraryCode/../../../amalgamation/juce_amalgamated_template.cpp:359:0,
from ../../JuceLibraryCode/../../../amalgamation/juce_amalgamated2.cpp:32,
from ../../JuceLibraryCode/JuceLibraryCode2.cpp:15:
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/drawables/juce_Drawable.cpp:43:1: error: ‘juce’ in class ‘juce::Drawable’ does not name a type
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/drawables/juce_Drawable.cpp:49:12: error: expected class-name before ‘::’ token
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/drawables/juce_Drawable.cpp:49:12: error: expected constructor, destructor, or type conversion before ‘::’ token
In file included from ../../JuceLibraryCode/../../../amalgamation/juce_amalgamated_template.cpp:369:0,
from ../../JuceLibraryCode/../../../amalgamation/juce_amalgamated2.cpp:32,
from ../../JuceLibraryCode/JuceLibraryCode2.cpp:15:
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/fonts/juce_Font.cpp:211:1: error: ‘juce’ in class ‘juce::Font’ does not name a type
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/fonts/juce_Font.cpp:216:1: error: ‘juce’ in class ‘juce::Font’ does not name a type
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/fonts/juce_Font.cpp:221:1: error: ‘juce’ in class ‘juce::Font’ does not name a type
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/fonts/juce_Font.cpp:226:1: error: ‘juce’ in class ‘juce::Font’ does not name a type
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/fonts/juce_Font.cpp:231:1: error: ‘juce’ in class ‘juce::Font’ does not name a type
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/fonts/juce_Font.cpp:242:8: error: expected class-name before ‘::’ token
../../JuceLibraryCode/../../../amalgamation/../src/gui/graphics/fonts/juce_Font.cpp:242:8: error: expected constructor, destructor, or type conversion before ‘::’ token
make: *** [build/intermediate/Debug/JuceLibraryCode2_683aaa00.o] Error 1
Finally, I modified juce_VSTPluginFormat.cpp again and commented out the lines that redefine Drawable, Font, etc… :
[code] $ cat src/audio/plugin_host/formats/juce_VSTPluginFormat.cpp
#include <pluginterfaces/vst2.x/aeffectx.h>
#if JUCE_MSVC
#pragma warning (pop)
#endif
//==============================================================================
//#if JUCE_LINUX
// #define Font JUCE_NAMESPACE::Font
// #define KeyPress JUCE_NAMESPACE::KeyPress
// #define Drawable JUCE_NAMESPACE::Drawable
// #define Time JUCE_NAMESPACE::Time
//#endif
#include “…/juce_PluginDescription.h”[/code]
Now if I run make, the build succeeds as expected.
Jules, sorry for the wall of text. I started writing this as I went and well, it turned more into my rambling notes to help me keep track. I’m still quite new to the codebase and was hoping to find my feet with the extras/ examples, so I have no idea if the above will break something else. From the thread I linked, it looks like you’ve encountered these issues elsewhere, and found fixes within the affected code. Could you confirm this change or provide more information on a possible fix? I haven’t really looked at the git repo yet, do you accept user submitted fixes or should I use the bug tracker on the sourceforge page in future?
Wow, so now that’s all over…
Hi, I’m new to the boards but have been lurking for a few weeks. I’m working on a performance-based sequencer and host and am eager to see how well juce can handle some of the heavy lifting so I can focus on the features and fun stuff I’m a software engineer and tester by day (c/c++ security middleware :S ), and techno/*step/uk-bass DJ and producer by night (and music software developer now too, it seems). I use a macbook at home and linux (my main OS) on my work/dev laptop, so my app will run on those (plus windows if I can find someone who wants to build/test on it). I’m sure I’ll be spending some time in the mac/linux/audio parts of the forum, so see you all then.
–sherman