When login as root, I make a project in qde, then run a simple program using getenv like this:
[color=blue]
#include <stdio.h>
#include <stdlib.h>
int main(int argc,char **argv)
{
char *path;
path=getenv(“PATH”);
if(path!=NULL)
printf(“PATH=%s\n”,path);
path=getenv(“PHOTON”);
if(path!=NULL)
printf(“PHOTON=%s\n”,path);
return EXIT_SUCCESS;
}
The program outputs:[color=red]
PATH=/sbin:/usr/sbin:/bin:/usr/bin
while command env outputs:[color=green]
…
PATH=/sbin:/usr/sbin:/proc/boot:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:
/opt/bin:/usr/photon/bin:/usr/photon/appbuilder:/opt/X11R6/bin:/usr/X11R6/bin
PHOTON=/dev/photon
…
Then I recompile this program like this:[color=red]
qcc pgm.c -V gcc_ntox86 -o pgm -g
and the program run normally and get everthing as same as env outputs.
Why getenv can’t get the value of global environ under qde just because that the qde use a different Makefile? Thanks a lot!