Skip to content

Tutorial ‐ creating cpp project in Visual Studio

Gombaris edited this page Apr 17, 2024 · 4 revisions

You can skip this step, and download the exising projects, together with files on Outerra/anteworld "Code" section in Tutorials/C++ tutorials.

You can also find the solution file (.sln) and plugins on Outerra/anteworld "Code" section in example folder.

Creating project

Start by creating new empty project.

Right click on your project in "Solution Explorer" and choose "Add -> New Item...".

Create .h file and .cpp file.

Reference

Right click on your project and choose "Add -> Reference...".

From "Projects" choose "comm_static".

Project properties

For our mod to work, we have to set correct project properties, for that, use property sheets, which are also available in "Code" section for download.

In Visual Studio go to Property manager, and in your project, right click on "Debug | x64", choose "Add Existing Property Sheet" and select vs_debug.props.

Do the same also for "Release | x64", but this time add vs_release.props.

The vs_paths.props will be added automatically.

Also delete "Debug | Win32" and "Release | Win32"

After that, right click on your project and choose Properties.

In Configuration Properties -> General change following settings:

Output Directory set your desired path in mods directory

$(ModsDir)\$(ProjectName)\

Configuration Type set to

Dynamic Library (.dll)

For all other properties, which have text in bold (means customized by you , or set by the wizard), choose "inherit from parent or project defaults" option.

Debugging

For debugging purposes in Visual Studio, you also have to set following properties in Configuration Properties -> Debugging :

Command - set path to outerra.exe file

$(TargetDir)..\..\..\..\outerra.exe

Command Arguments - set following arguments

--no-restart 
--project ".\bin\project\Outerra World Sandbox"