views:

15

answers:

0

Hi !

I'm trying to execute mingw's g++ from inside a cgi written for apache. The line I execute is:

c:\mingw\bin\g++.exe -Wall -IC:\hpxbase -O2 -c -v -o code.o code.cpp

This works when I call exactly this line from a cmd window. But when run from my cgi, g++ crashes. I made the cgi open up ots own console window and there is the message "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information." There is also this windows dialog on top "g++.exe has stopped working A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." No compiled files get created.

What's really odd, the same line works from the cmdline. Also a more trivial command like "g++ --help" displays the help in the browser. But compiling a hello world already crashes it.

I already tried giving apache admin rights, which didn't change it.

Any ideas what this could be?

Thx Marc

[edit] I compared the environment variables of a cmdline with the environment variables of the created cgi process. I noticed that lang and TEMP and TMP weren't set. So I set them myself. Now, I don't get the g++ crash error anymore, but it still doesn't compile. g++ exits with error code 1 now. What does that mean? [/edit]