alex chpenst
30th July 2008, 14:42
Hi,
My program needs to get a list of users on the system. From linux shell it works fine:
# who | cut -d' ' -f1 | sort -u
When I start this from code I get an error with exit code 255. I've read that this means that some libraries can't be found. What libraries are necessary and how and where to declare them for C++ program? Are these libraries for who, cut and sort commands?
QProcess exec;
exec.start( "who|cut -d' ' -f1|sort -u" );
exec.waitForFinished();
int exitcode = exec.exitCode(); // exitcode is always 255!
Thanks!!
My program needs to get a list of users on the system. From linux shell it works fine:
# who | cut -d' ' -f1 | sort -u
When I start this from code I get an error with exit code 255. I've read that this means that some libraries can't be found. What libraries are necessary and how and where to declare them for C++ program? Are these libraries for who, cut and sort commands?
QProcess exec;
exec.start( "who|cut -d' ' -f1|sort -u" );
exec.waitForFinished();
int exitcode = exec.exitCode(); // exitcode is always 255!
Thanks!!