top of page

Tutorial 1: Setup Project

In this tutorial you will learn how to start a ness-engine project on Visual Studio, for x86 or x64 platform.

#include <NessEngine.h>

 

int _tmain(int argc, _TCHAR* argv[])

{

    return 0;

}

That's it. :)

Your project should now compile and be ready to begin the next tutorials!
 
continue to next tutorial -->

Now extract ness-engine archive into your project dir. if you used visual studio your project dir should look something like this:

Step 3: add include directory

You need to add ness-engine include dir to your project include directories. If you are using visual studio, open Project Properties, go to VC++ Directories tab, and under the Include Directories property add the following path: 

$(ProjectDir)\ness-engine\include\

 

It should look like this (note: do this for All Configurations, not just debug or release):

Step 4: create main

Create a new cpp file, main.cpp, and add the following code:

This is your application entry point, your main function.

note: in some compilers it might be OK to define as "int main()", but in visual studio 2010 and older (compiler v100) it will not work with a different signature.

 

Make sure this code compiles.

 

Step 5: add libraries path and copy files for your compiler

You need to add the libraries dir to your project search path, so it will know where to find the .lib files.

 

If you are using visual studio, open Project Properties, go to VC++ Directories tab, and under the Library Directories property add the following path: 

$(ProjectDir)\ness-engine\lib\win_x86\ 

 

or if you are compiling for x64: 

$(ProjectDir)\ness-engine\lib\win_x64\

 

It should look like this (note: do this for All Configurations, not just debug or release):

Step 6: set additional dependencies

Now that your project knows where the ness-engine libs are, it's time to tell the linker to use them.

 

If you are using Visual Studio, open Project Properties, expand Linker options and choose Input tab. edit the  Additional Dependencies property:

 

For Debug configurations add ness_engine_d.lib

For Release configurations add ness_engine.lib

 

It should look like this (note: this example is for Debug, remove the '_d' for release mode):

 

Try to compile and make sure your project can find all the libs files!

Note: when you will release your project or if you just want to run the exe from outside visual studio, you will need to include all the dlls in the same directory as the exe!

 

If you don't use Visual Studio or just don't like this method, you can choose one of the following alternatives:

  1. copy all the dlls from the libraries dir into the folder from which your application executes.

  2. add the libraries path to your system PATH.

Step 1: download ness-engine

If you haven't downloaded the engine fies yet, go to this page and download the distribution for your operating system.

 

Note: if you are using code::blocks IDE you need to replace the content of the header file 
ness-engine/include/SDL_platform.h with this file.

special thanks to dazed for the fix! :)

 

Step 2: create project

Create a new empty project and extract ness-engine into your project dir.

If you are using visual studio it will look something like this:

 

Step 7: add dlls path

When your application actually runs, it will look for the dll files to link with with (hence the name Dynamic-link library...)

 

So you need a way to tell your executable where to find them.

 

If you are using Visual Studio, the best way to make sure your application can find the dlls is to set the environment variable when running the application. To do so go to Project Properties, open the Debugging tab, and set the Environment property to:

PATH=%PATH%;$(ProjectDir)\ness-engine\lib\win_x86\

 

or if you are using 64 bit:

PATH=%PATH%;$(ProjectDir)\ness-engine\lib\win_x64\

 

It should look like this (note: do this for All Configurations, not just debug or release):

Now there is one more step to do - pick the libs and dlls for your specific compiler.

 

In the libraries path (ness-engine\lib\win_x86\ or ness-engine\lib\win_x64\) you will find a directory for every compiler supported (for example ness-engine\lib\win_x86\vs2013). all you have to do is copy all the files from your compiler of choice into the libraries dir.

 

for example if you are using visual studio 2013 for x86, you need to copy all the files from 

ness-engine\lib\win_x86\vs2013\ into ness-engine\lib\win_x86\ (one dir up):

Help ness-engine grow!

bottom of page