# Gcc visibility tweak improvement

**URL:** <https://forum.juce.com/t/gcc-visibility-tweak-improvement/2476>\
**Category:** Audio Plugins\
**Created:** [January 8, 2008, 9:29am UTC](https://forum.juce.com/t/gcc-visibility-tweak-improvement/2476 "2008-01-08T09:29:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [January 8, 2008, 9:29am UTC](https://forum.juce.com/t/gcc-visibility-tweak-improvement/2476/1 "2008-01-08T09:29:09Z")

</div>

i’ve noticed that on gcc, compiling vst shared libraries results in quite big objects. i’ve tweaked a bit with gcc and i found the **attribute** ((visibility)) pragma.

if you do like this in juce\_premake.lua

```auto

```

then in VSTWrapper.cpp code you add:

```auto
#if JUCE_LINUX // blah blah

extern "C" __attribute__ ((visibility("default"))) AEffect* main_plugin (audioMasterCallback audioMaster) asm ("main");

extern "C" __attribute__ ((visibility("default"))) AEffect* main_plugin (audioMasterCallback audioMaster)
```

and you build your pluguin with -fvisibility=hidden linkflag (audio plugin’s premake.lua)…

```auto

```

i’ve been able to smash more than 600kb from the shared library (and things work the same, both statically and dinamically)!

it’s a small tweak but good to have !!

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 8, 2008, 12:28pm UTC](https://forum.juce.com/t/gcc-visibility-tweak-improvement/2476/2 "2008-01-08T12:28:10Z")

</div>

ah - good tip! I’ll put that into the build - thanks!
