Setting Up with .NET CLI - sinusinu/Flora GitHub Wiki
This document assumes that you have already installed .NET 6 SDK or newer.
-
Open Command Prompt on selected location.
-
Create a new project with
dotnet new console
.
⚠️ Flora strictly supports x64 platform only. If any other platform (including Any CPU) is used, it may cause random crashes and memory corruption.
-
Open
(Your project name).csproj
file with text editor. -
On left pane, Click
Configuration Properties
. -
Inside
<PropertyGroup>
, Insert following line:
<PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms>
Like this:
<PropertyGroup>
...
<PlatformTarget>x64</PlatformTarget>
<Platforms>x64</Platforms>
...
</PropertyGroup>
- Save.
-
On Project's root directory, Open Command Prompt.
-
Add reference to Flora with
dotnet add reference path\to\flora\Flora.csproj
Flora requires external libraries to work properly. These files need to be copied into build folder whenever the project is built.
By using simple post-build event, we can automate copying process.
-
On Project's root directory, Create a new folder named
extlibs
. -
Open
(Your project name).csproj
file with text editor. -
Inside
<Project>
, Insert following lines:
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command='xcopy "$(ProjectDir)extlibs\\*.*" "$(TargetDir)" /Y' />
</Target>
Like this:
<Project Sdk="...">
...
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command='xcopy "$(ProjectDir)extlibs\\*.*" "$(TargetDir)" /Y' />
</Target>
...
</Project>
-
Save.
-
Place these files into
extlibs
folder.
SDL2.dll (2.0.22)
SDL2_ttf.dll (2.0.18)
soloud_x64.dll (20200207)
Now you may continue to Simple Program.