Mail Archives: djgpp/1999/03/09/05:07:45
On Mon, 8 Mar 1999, Edward F. Sowell wrote:
> That is, if both buildsolxx.cpp and
> tstCreateProcess.cpp are compiled/linked with MS VC++ tools, everything
> works as expected. However, if the launched program (buildsolxxx.exe)
> is created with DJGPP compiler/linker (e.g., using rhide),
> there is no error reported from spawnl(), but the process is not
> in fact executed... i.e., the buildsol.log file is not created, etc.
Are you sure the DJGPP program doesn't start at all? Maybe it just
fails to produce the expected results, for some reason?
What happens if you try to run the program via COMMAND.COM
(e.g. "command.com /c foo.exe")? Or just call `system' instead of
`spawn'.
I don't know how does `spawn' in MSVC work, it could do something that
fails with DJGPP (or otherwise DOS) programs.
> to spawn a "make" program. If buildsolver is compiled with MS VC++,
> it will not work, apparently because the command line (in the spawnl()
> arg list) gets chopped at 126 characters.
DJGPP doesn't support the method used by Win32 programs to pass long
command lines. If you can describe that method in detail, maybe the
DJGPP startup code could be changed to support it.
> int spawnres = spawnl(P_WAIT, argv[1], argv[1], argv[2],argv[3], NULL);
> if (spawnres != 0) {
> cout << endl;
> perror("Spawn returned an error in buildsolver.");
> }
This is too complicated, since it involves argv[1] passed from
somewhere else. I suggest to throw together a simple test program
that calls spawnl with a known constant string, then post the results.
Btw, the error code returned by spawnl is not the only error
indicator; errno is another.
- Raw text -