问题描述:

i'm trying to use the convert terminal command in a C program using system function, this is the code piece

\#include <stdlib.h>

...

system("cd /Users/myUser/Desktop/photos/pgm;for i in *.jpg; do convert $i

-compress none -scale 32x24! $i.pgm; done;")

But I cant run the convert command, this is the program output:

sh: convert: command not found

I can run the same command in Terminal without problems

网友答案:

Check the full path to convert using which convert. Then exchange the full path in your C program.

相关阅读:
Top