Page 1 of 1
makefile
Posted: Wed Sep 22, 2004 8:09 pm
by dirk
Hi there,
I don't want to set the path's and options for the compiler in the Dialogs because I have to compile with several compilers.
So I'm writing my own makefiles. If I try to make(Workspace Make) or Compile (in Compile/Option Commandline = Make)
I get the Error
cl -o testzeus main.obj /link /LIBPATH:"C:\Programme\Microsoft Visual C++ Toolkit 2003\lib" /LIBPATH:"C:\Programme\Microsoft Platform SDK for Windows XP SP2\LIB" user32.lib gdi32.lib program.res
process_easy: DuplicateHandle(In) failed (e=6)
make: Interrupt/Exception caught (code = 0xc0000005, addr = 0x4163a4)
The makefile runs in the shell.
Have you an idea?
dirk
Posted: Thu Sep 23, 2004 2:26 pm
by jussij
Which version of windows are you running? When it comes to spawing processes each version of Windows does have a habit of working slightly differently
To check that it is not some sort of environment variable issue, use the
Options Editor Options menu and in the
General section turn on the
Help debug tools, macros and executables option. With this option enabled Zeus will display the make command line that it being run.
Next use the
Tools, Dos Shell menu to bring up a command prompt and run the same make command. This would hopefully result in the same runtime error and if it does this means the error is environment related.
Code: Select all
cl -o testzeus main.obj /link /LIBPATH:"C:\Programme\Microsoft Visual C++ Toolkit 2003\lib" /LIBPATH:"C:\Programme\Microsoft
Platform SDK for Windows XP SP2\LIB" user32.lib gdi32.lib program.res
process_easy: DuplicateHandle(In) failed (e=6)
make: Interrupt/Exception caught (code = 0xc0000005, addr = 0x4163a4)
I am assuming this compile was run by the make tool. What type of make utility is it? Is the make utility a DOS or a Win32 based executable? It does not look like the microsoft
nmake tool.
One other thing worth trying is setting up a tool to run the make and see if tool behaves in the same manner. Also try running the tool visible, but turn off the option to capture the output and see if that has any effect.
Jussi
make
Posted: Thu Sep 23, 2004 5:53 pm
by dirk
Hi Jussi,
first of all thanks for your fast reply!
I'm working with Windows XP SP2.
If I use Toos/DosShell the make command works.
I'm using GNU Make version 3.78.1 compiled for Win32.
If I disable capture standard error I get the message "Compilation completed successfully" but nothing is done(no exe file). I see only the fist line of my makefile in the compileroutputwindow, the second is missing.
If I'm enable capture standard error I get the message I've send yesterday.
If I disable both it works fine.
dirk
Posted: Fri Sep 24, 2004 1:59 am
by jussij
If I use Toos/DosShell the make command works.
That rules out the environment variables
I'm using GNU Make version 3.78.1 compiled for Win32.
....
If I disable both it works fine. [Very Happy]
As the names of the check boxes suggest, they control what program output Zeus will try to capture. So it looks like the make utility is not happy with Zeus trying to capture its output
Looking back, the error message
DuplicateHandle(In) failed (e=6) hints of this fact. As to why the this is happening, unfortunately I have no idea
But there are two other options that may yet fix the output capture problem entirely. Currently I am assuming you have a command line something like this:
or something similar.
The first option would be to create a
my_make.cmd batch file as the follows:
Code: Select all
@echo off
echo Running my_make.cmd for make file: %1
make -f %1
and then change the make command line to read:
This means Zeus will be running the command interpreter and the command intepreter is left to run the make program. With some luck this may trick the make into running even with the Zeus capture on.
If that does not work, the final option would be to change the batch file to read:
Code: Select all
@echo off
echo Running my_make.cmd for make file: %1
make -f %1 >>%1.err 2>&1
type %1.err
This batch file sends the stdout of the make to a file with the extension of err and sends the stderr output to stdout. The net result is all output produced by the make should end up in the err file. The final
type command then sends the err file to stdout. So using this batch file you can run the make command with Zeus only capturing the stdout and again with some luck this may work.
Jussi
Posted: Fri Sep 24, 2004 2:20 am
by jussij
In an effort to better understand this bug, I ran a quick search of google for the error message:
DuplicateHandle(In) failed (e=6)
From the results found it appears that Zeus is not the only IDE are having problems with this GNU make utility.
Jussi
Posted: Sat Sep 25, 2004 7:49 am
by Guest
hi jussi,
with a little change the batch runs.
Code: Select all
@echo off
command /c make -f Makefile > makefile.err 2>>&1
type Makefile.err
I have to start make in his own enviroment (command /c) otherwise make becomes the error with the duplicated handel.
dirk
Posted: Sat Sep 25, 2004 8:01 am
by jussij
Hi Dirk,
with a little change the batch runs.
That is good news
@echo off
command /c make -f Makefile > makefile.err 2>>&1
type Makefile.err
I have to start make in his own enviroment (command /c) otherwise make becomes the error with the duplicated handel.
Very nice idea

I can see how that would help.
Does it also work if you use
cmd.exe /c instead of
command.exe /c. The
command.exe is the older DOS command interpreter where as
cmd.exe is the newer NT command interpreter, so it might be better to use
cmd.exe if you can.
Jussi
makefile
Posted: Mon Sep 27, 2004 5:15 pm
by dirk
Hi Jussi,
I see no chance with cmd.exe /C because it use the handle off the first batch. I've tested it with cmd.exe /C CALL but there ist the same error.
so good old dos...
dirk
Posted: Tue Sep 28, 2004 1:12 am
by jussij
Hi Dirk,
I've tested it with cmd.exe /C CALL but there ist the same error.
so good old dos...
That is very strange indeed. I guess some of the weird things DOS does with file handles somehow makes it work.
But at least you now have found something that DOS does well
Cheers Jussi
Posted: Mon Jun 20, 2005 12:56 am
by jussij
Bfmitch posted the following
Gnu Make Two Step as an alternative fix to this problem.
Jussi