# Bug in Projucer Linux project exporters for plug-ins

**URL:** <https://forum.juce.com/t/bug-in-projucer-linux-project-exporters-for-plug-ins/23454>\
**Category:** The Projucer\
**Created:** [July 26, 2017, 10:38am UTC](https://forum.juce.com/t/bug-in-projucer-linux-project-exporters-for-plug-ins/23454 "2017-07-26T10:38:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolframfranke](https://avatars.discourse-cdn.com/v4/letter/w/8797f3/32.png) [@wolframfranke](https://forum.juce.com/u/wolframfranke)\
**Post date:** [July 26, 2017, 10:38am UTC](https://forum.juce.com/t/bug-in-projucer-linux-project-exporters-for-plug-ins/23454/1 "2017-07-26T10:38:34Z")

</div>

Hi everyone,

on Linux, gcc defaults to make all symbols visible when building shared object binaries such as plug-ins. This results in funny side effects or even crashes when either several instances of the same plug-in or different plug-ins with a common code base and therefore identical symbol names are loaded into a DAW.  
The Projucer tries to take care of that but does it wrongly: it sets “-fVisibility=hidden” as a linker flag but it should rather set it as a C compiler flag.

So, the following changes should be made:

jucer\_ProjectExport\_Make.h:

```
void writeLinkerFlags (OutputStream& out, const BuildConfiguration& config) const
{
    out << " JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR)";
    
    {
        StringArray flags (makefileExtraLinkerFlags);
        if (flags.size() > 0)
            out << " " << getCleanedStringArray (flags).joinIntoString (" ");
    }
    
    [...]

}

```

and:

```
StringArray getTargetSettings (const BuildConfiguration& config) const
{
    [...]

    if (getTargetFileType() == sharedLibraryOrDLL || getTargetFileType() == pluginBundle)
    {
        s.add (String ("JUCE_CFLAGS_") + getTargetVarName() + String (" := -fPIC -fvisibility=hidden"));
        
        [...]
        
    }
    
    [...]
    
}

```

jucer\_ProjectExport\_CodeBlocks.h:

```
StringArray getCompilerFlags (const BuildConfiguration& config, CodeBlocksTarget& target) const
{
    [...]

    if (config.exporter.isLinux())
    {
        if (target.isDynamicLibrary() || getProject().getProjectType().isAudioPlugin())
            flags.add ("-fPIC -fvisibility=hidden");
        
        [...]
        
    }
    
    [...]
    
}

```

Best wishes,

Wolfram
