# Building Unity Windows/MacOS player on Linux references wrong libraries?

**URL:** <https://qa.fmod.com/t/building-unity-windows-macos-player-on-linux-references-wrong-libraries/13553>\
**Category:** Unity\
**Created:** [November 23, 2017, 12:33pm UTC](https://qa.fmod.com/t/building-unity-windows-macos-player-on-linux-references-wrong-libraries/13553 "2017-11-23T12:33:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kalms](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@Kalms](https://qa.fmod.com/u/Kalms)\
**Post date:** [November 23, 2017, 12:33pm UTC](https://qa.fmod.com/t/building-unity-windows-macos-player-on-linux-references-wrong-libraries/13553/1 "2017-11-23T12:33:58Z")

</div>

Hi,

Just a heads up, build a Windows player on a Linux machine does not work with the current Unity integration. I get errors like these during build time:

Refreshing native plugins compatible for Editor in 41.29 ms, found 7 plugins.  
Couldn’t open Assets/External/FMOD/Plugins/x86\_64/libfmodstudio.so, error: libfmod.so: cannot open shared object file: No such file or directory  
FMOD.Memory:GetStats(Int32&, Int32&) (at Assets/External/FMOD/Plugins/FMOD/Wrapper/fmod.cs:1810)  
FMOD.Memory:GetStats(Int32&, Int32&) (at Assets/External/FMOD/Plugins/FMOD/Wrapper/fmod.cs:1809)  
FMODUnity.RuntimeUtils:EnforceLibraryOrder() (at Assets/External/FMOD/Plugins/FMOD/RuntimeUtils.cs:391)  
FMODUnity.EditorUtils:CreateSystem() (at Assets/External/FMOD/Plugins/Editor/FMOD/EditorUtils.cs:247)  
FMODUnity.EditorUtils:get\_System() (at Assets/External/FMOD/Plugins/Editor/FMOD/EditorUtils.cs:322)  
FMODUnity.EventManager:UpdateCache() (at Assets/External/FMOD/Plugins/Editor/FMOD/EventManager.cs:129)  
CustomBuild:UpdateFMODBanks() (at Assets/Scripts/Editor/CustomBuild/CustomBuild.cs:100)  
CustomBuild:GenerateWindows64Build() (at Assets/Scripts/Editor/CustomBuild/CustomBuild.cs:63)

I think this is because some #defines in fmod.cs (and perhaps also RuntimeUtils.cs) have arguments in the wrong order.

More specifically, there is this block:

```
/*
    FMOD version number. Check this against FMOD::System::getVersion / System_GetVersion
    0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number.
*/
public class VERSION
{
    public const int number = 0x00010906;

```

#if (UNITY\_IPHONE || UNITY\_TVOS || UNITY\_SWITCH) && !UNITY\_EDITOR  
public const string dll = “\_\_Internal”;  
#elif (UNITY\_PS4) && !UNITY\_EDITOR  
public const string dll = “libfmod”;  
#elif (UNITY\_PS4) && DEVELOPMENT\_BUILD  
public const string dll = “libfmodL”;  
#elif (UNITY\_PSP2 || UNITY\_WIIU) && !UNITY\_EDITOR  
public const string dll = “libfmodstudio”;  
#elif (UNITY\_EDITOR\_WIN) || (UNITY\_STANDALONE\_WIN && DEVELOPMENT\_BUILD)  
public const string dll = “fmodstudiol”;  
#elif (UNITY\_EDITOR\_OSX) || (UNITY\_STANDALONE\_OSX && DEVELOPMENT\_BUILD)  
public const string dll = “fmodstudioL”;  
#elif (UNITY\_STANDALONE\_OSX || UNITY\_STANDALONE\_WIN)  
public const string dll = “fmodstudio”;  
#elif (UNITY\_EDITOR\_LINUX) || ((UNITY\_STANDALONE\_LINUX || UNITY\_ANDROID || UNITY\_XBOXONE) && DEVELOPMENT\_BUILD)  
public const string dll = “fmodL”;  
#else  
public const string dll = “fmod”;  
#endif  
}

When building a player on a Linux machine and targetting Windows, both UNITY\_EDITOR\_LINUX and UNITY\_STANDALONE\_WIN will be set when Unity is compiling code for use within the editor. Some #elifs need to be moved around so that UNITY\_EDITOR\_{WIN,OSX,LINUX} always are detected before UNITY\_STANDALONE\_{WIN,OSX,LINUX}. Specifically, this block:

#elif (UNITY\_EDITOR\_LINUX) || ((UNITY\_STANDALONE\_LINUX || UNITY\_ANDROID || UNITY\_XBOXONE) && DEVELOPMENT\_BUILD)  
public const string dll = “fmodL”;

… should be before this block:

#elif (UNITY\_STANDALONE\_OSX || UNITY\_STANDALONE\_WIN)  
public const string dll = “fmodstudio”;

With that change, I am able to build a Windows player on a Linux machine.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [November 26, 2017, 11:40pm UTC](https://qa.fmod.com/t/building-unity-windows-macos-player-on-linux-references-wrong-libraries/13553/2 "2017-11-26T23:40:37Z")

</div>

Thanks for bringing this to our attention, I will get this fix added for the next release.
