corrected compilation & run with libraries