Elektra 0.8.26
|
This basic tutorial shows you how to compile and run a very basic Elektra application. For this tutorial we assume that you installed Elektra and CMake on your machine. We also assume that you work a Unix based OS like Linux or macOS.
Hello
somewhere on your diskexamples/helloElektra.c
to the folder Hello
you just createdSave a file with the following content
as CMakeLists.txt
in the folder Hello
.
Hello
Create a build directory inside Hello
, change into the build directory, and run Cmake:
. If everything worked until now, then CMake should print messages that look something like this:
No it’s time to build your application. For that step run make
inside the folder Hello/build
:
. If the last step completed successfully, then the build directory now contains the application hello
.
You can now run your Elektra application by calling ./hello
inside the build directory. The output of the application should look something like this:
helloElektra.c
. If you want to compile and execute the updated code, then repeat steps 6 and 7.