# Preprocessor definitions for Standalone Plugins only \[SOLVED\]

**URL:** <https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735>\
**Category:** General JUCE discussion\
**Created:** [June 4, 2019, 8:03pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735 "2019-06-04T20:03:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [June 4, 2019, 8:03pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/1 "2019-06-04T20:03:18Z")

</div>

Is there a way to set preprocessor definitions for only the “standalone” “vst3” etc. build targets?

---

<div class="post-metadata">

**Author:** ![mcmartin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mcmartin/32/7432_2.png) [@mcmartin](https://forum.juce.com/u/mcmartin)\
**Post date:** [June 4, 2019, 8:10pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/2 "2019-06-04T20:10:34Z")

</div>

Did you already have a look at [A Format Only Code](https://forum.juce.com/t/a-format-only-code/32800) and [Standalone vs VST defs](https://forum.juce.com/t/standalone-vs-vst-defs/33298)?

---

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [June 4, 2019, 8:15pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/3 "2019-06-04T20:15:12Z")

</div>

> [@McMartin](#):
>
> Did you already have a look at [A Format Only Code](https://forum.juce.com/t/a-format-only-code/32800) and [Standalone vs VST defs](https://forum.juce.com/t/standalone-vs-vst-defs/33298)?

No and no! Thanks and sorry for the duplicate quesiton 🙂

---

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [June 4, 2019, 8:58pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/4 "2019-06-04T20:58:27Z")

</div>

> [@McMartin](#):
>
> Did you already have a look at [A Format Only Code](https://forum.juce.com/t/a-format-only-code/32800) and [Standalone vs VST defs](https://forum.juce.com/t/standalone-vs-vst-defs/33298)?

Ok I have two followup questions:

1. `JUCEApplicationBase::isStandaloneApplication()` seems to be not found by my compiler? Do I need to add a specific module or include anything?

2. (only necessary if 1. cant be resolved) Where do I turn off the “shared code” option, so the defines dont get set all at once?

Thanks

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [June 4, 2019, 9:00pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/5 "2019-06-04T21:00:18Z")

</div>

You can check during runtime if your plugin is running as a standalone with your AudioProcessor’s wrapperType member. (Check if it’s set to wrapperType\_Standalone.)

---

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [June 4, 2019, 9:08pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/6 "2019-06-04T21:08:16Z")

</div>

> [@Xenakios](#):
>
> with your AudioProcessor’s wrapperType member. (Check if it’s set to wrapperType\_Standalone.)

wrapperType member? Please elaborate! My processor seems to have no such member and a repo wide search for “wrapper” turned out blank.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [June 4, 2019, 9:09pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/7 "2019-06-04T21:09:53Z")

</div>

It’s a member of the AudioProcessor base class in Juce itself.

---

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [June 4, 2019, 10:11pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/8 "2019-06-04T22:11:38Z")

</div>

Ok that worked out!

Thank you both for your answers, much appreciated! 🙂

---

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [June 9, 2019, 7:59pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/9 "2019-06-09T19:59:12Z")

</div>

> [@Xenakios](#):
>
> You can check during runtime if your plugin is running as a standalone with your AudioProcessor’s wrapperType member. (Check if it’s set to wrapperType\_Standalone.)

Hmmm I just found this will always be true, even in VSTs for some reason… Am I doing this right?

```auto
m_is_standalone_plugin = (typeid(wrapperType) == typeid(wrapperType_Standalone));

```

---

<div class="post-metadata">

**Author:** ![mcmartin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mcmartin/32/7432_2.png) [@mcmartin](https://forum.juce.com/u/mcmartin)\
**Post date:** [June 9, 2019, 8:08pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/10 "2019-06-09T20:08:43Z")

</div>

Why are you using `typeid`? You should be comparing `wrapperType` with `wrapperType_Standalone` directly, i.e.

```auto
wrapperType == wrapperType_Standalone

```

---

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [June 9, 2019, 8:12pm UTC](https://forum.juce.com/t/preprocessor-definitions-for-standalone-plugins-only-solved/33735/11 "2019-06-09T20:12:22Z")

</div>

Ok now it works. I figured the WrapperTypes would be different subclasses to wrap the plugin, not literal type identifiers 😄  
Anyway thank you!
