[Solved] Compile error [freeimage.dll x64]

Hello guys,

I installed xenko 2.0.4.1 and load example project from xenko.
And then I tried to build project, error occurred below.

Error: Exception in command SiliconStudio.Xenko.Assets.Textures.TextureConvertParameters: System.TypeInitializationException: ‘SiliconStudio.TextureConverter.TextureTool’ のタイプ初期化子が例外をスローしました。 —> System.InvalidOperationException: Could not load native library FreeImage.dll from path [C:\Program Files\Silicon Studio\Xenko\Bin\Windows\x64\FreeImage.dll] using CPU architecture x64.

My environment : windows10 x64

I tried another project(empty project, another example project), same error occurred.

Best regards,

Did you open the solution in Visual Studio manually? Since more than one version of Xenko can be installed, an environment variable is used to figure out which version to use. You need to open the solution from the GameStudio in order for the that environment variable to be correctly set to a particular version.

Note that this environment variable should already be set to the installation folder of Xenko and then thanks to the .props file that is generated with each Xenko project the supported version of Xenko can be guessed/computed. Anyway that’s implementation details and usually you don’t have to bother about it.

To do it manually though, set SiliconStudioXenkoDir with the path to the version you want to use before opening the solution in Visual Studio. For example if you are using 2.0.4.1, it should be:

set SiliconStudioXenkoDir="C:\Program Files\Silicon Studio\Xenko\GamePackages\Xenko.2.0.4.1\"

Thank you for your quick response!

But, I used Xenko GameStudio.
And I installed Xenko 2.0.4.1 only…

If you know, please tell me about adding environment value in Xenko GameStudio.

Regards,

So you tried to build from the Game Studio? I thought you did it from Visual Studio because you error you have is typical of the case when the project is open in Visual Studio manually. The path to any binaries should resemble the one I mentioned above, i.e. include GamePackages\Xenko.2.0.4.1 before Bin.

Can you give me the listing of files folder you see under C:\Program Files\Silicon Studio\Xenko\Bin (maybe a screenshot can help).

Another thing you can try is reinstalling Xenko. Make sure to install it in the default folder (i.e. C:\Program Files\Silicon Studio\Xenko).

Thank you for your response.

I tried to reinstall and install Visual Studio Community Edition.
It works fine!

I could solve the problem.

Thank you very much for your help!

Best Regards,

Hi there,

so I am actually having the same issue and I can’t solve it. I am on Win 10 x64 too. The error occurs in Xenko Game Studio as well as in VS 2015 and 2017. I tried different project templates (SimpleAudio, New Game) but got the same error everywhere.

I did set the environment variable to “C:\Program Files\Silicon Studio\Xenko\GamePackages\Xenko.2.1.0.3” but the path in the error message remains “C:\Program Files\Silicon Studio\Xenko\Bin\Windows\x64\FreeImage.dll”

I also copied the whole “Bin”-Directory from “C:\Program Files\Silicon Studio\Xenko\GamePackages\Xenko.2.1.0.3\Bin” two levels up to “C:\Program Files\Silicon Studio\Xenko\Bin” but the error message stays the same:

Error: Exception in command SiliconStudio.Xenko.Assets.Textures.TextureConvertParameters: System.TypeInitializationException: Der Typeninitialisierer für “SiliconStudio.TextureConverter.TextureTool” hat eine Ausnahme verursacht. —> System.InvalidOperationException: Could not load native library FreeImage.dll from path [C:\Program Files\Silicon Studio\Xenko\Bin\Windows\x64\FreeImage.dll] using CPU architecture x64.

Would be so great to use Xenko but it seems I got stuck right at the start. Any help is very apreciated.

Best Regards

Uninstalled Xenko.2.1.0.3 and installed Xenko.2.0.4.1 … changed the environment variable accordingly … created a “New Game” with it … and … got the exact same error again :frowning: