The app is portable, and under Windows, it works without problems, but under Linux it fails - the env var seems to be not inherited. We tried several methods, and all failed (like calling system("export var=...") before launching the process).
Hi brainspoon,
The reason system("export var=...") doesn't work is because system creates a seperate process and executes the export command in that process. Therefore the environment of this new process (and its children) will be changed, but the environment for your existing program (and hence any other programs it calls) will still be the same.
If you want to set environment variables using C, then including stdlib.h will give you getenv and putenv functions.
Alternatively, I expect you can use the shell to do it when you make the system call, although I suspect that is making it very unix specific.
system("env VARIABLE=value script.sh");
frog-x