print error messages using std::cerr
compilable on ubuntu