I'm following an introductory tutorial about vala and I want to make a simple application that simply shutdown the computer using the command shutdown now
. I checked out this question Executing system command in Vala, and I found that I have to use a package named posix. I tried to add the following line in the activate
method of my Application class:
Posix.system("shutdown now");
Then compile using:
valac --pkg gtk+-3.0 posix Application.vala
However, I got the following Error:
error: posix not found
Compilation failed: 1 error(s), 0 warning(s)
Sorry for this question but I'm new comer from scripting languages and I don't no how to quickly include libraries in Vala.