makefile

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
dirk

makefile

Post 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
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post 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
dirk

make

Post 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. :D

dirk
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post 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:

Code: Select all

make -f "$pf"
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:

Code: Select all

my_make.cmd "$pf"
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
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post 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
Last edited by jussij on Sun Jul 12, 2009 5:28 am, edited 1 time in total.
Guest

Post by Guest »

hi jussi,
with a little change the batch runs. :D

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
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post 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
dirk

makefile

Post 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
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post 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
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Bfmitch posted the following Gnu Make Two Step as an alternative fix to this problem.

Jussi
Post Reply