In a GThread I have code as such
char *commandLine [1024];
sprintf(commandLine, "gcc myfile.c -o myfile.exe 2>&1");
FILE* pipein_fp;
extern FILE* popen();
static char buffer [1024];
pipein_fp = popen(commandLine, "r");
while(fgets(buffer, 1024, pipein_fp) != NULL) g_print("\n%s", buffer);
pclose(pipein_fp);
so 2>&1
is supposed to redirect stderr to stdout and the piped g_print is supposed to print out the gcc's stderr output. But it does nothing.
What am I possibly doing wrong ?