Problems with Windows installer, v1.8.0

Installing on windows
Post Reply
ElectroDruid
New member
Posts: 3
Joined: Sun Oct 12, 2008 6:30 pm

Problems with Windows installer, v1.8.0

Post by ElectroDruid »

Hi,

Please excuse me if I'm doing something stupid here, I'm new to z88dk...

Having run the installer (I'm using Windows Vista, for my sins), and added the Path environment variable, my environmnent variables look like this:

Code: Select all

Path: C:\Program Files\z88dk\bin
TEMP: C:\Users\Steve\AppData\Local\Temp
TMP: C:\Users\Steve\AppData\Local\Temp
Z80_OZFILES: C:\Program Files\z88dk\lib\
ZCCCFG: C:\Program Files\z88dk\lib\config\
As a test, I've opened a DOS prompt, navigated to the SAM Coupe examples directory (that's the platform I'm interested in compiling for), and tried to build the hello world program, with the following results:

Code: Select all

C:\Program Files\z88dk\examples\sam>zcc +sam hello.c -o hello
copy C:\PROGRA~1\z88dk\lib\sam_crt0.opt C:\Users\Steve\AppData\Local\Temp\s3es_1
.opt
        1 file(s) copied.
copy C:\Users\Steve\AppData\Local\Temp\s3es_1.opt C:\Users\Steve\AppData\Local\T
emp\s3es_1.asm
        1 file(s) copied.
zcpp -I. -DZ80 -DSMALL_C -DSAM -D__SAM__ -DSCCZ80 -IC:\PROGRA~1\z88dk\include  h
ello.c C:\Users\Steve\AppData\Local\Temp\s3es_.i
sccz80    -//  C:\Users\Steve\AppData\Local\Temp\s3es_.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 < C:\Users\Steve\AppData\Local\Temp\s3es_.
asm > C:\Users\Steve\AppData\Local\Temp\s3es_.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 < C:\Users\Steve\AppData\Local\Temp\s3es_.
op1 > C:\Users\Steve\AppData\Local\Temp\s3es_.opt
z80asm -eopt -ns -Mo C:\Users\Steve\AppData\Local\Temp\s3es_.opt
z80asm -a -m -Mo -ohello -iC:\PROGRA~1\z88dk\lib\clibs\ndos  -iC:\PROGRA~1\z88dk
\lib\clibs\sam_clib  -iC:\PROGRA~1\z88dk\lib\clibs\z80_crt0  C:\Users\Steve\AppD
ata\Local\Temp\s3es_1.opt C:\Users\Steve\AppData\Local\Temp\s3es_.o

C:\Program Files\z88dk\examples\sam>
Everything seems to be fine from the output (I think?) but I don't see any files generated, either in the examples folder or the Temp folder. I've tried again, this time trying to generate the assembly file rather than the compiled binary, and I get this:

Code: Select all

C:\Program Files\z88dk\examples\sam>zcc +sam hello.c -o hello -a
zcpp -I. -DZ80 -DSMALL_C -DSAM -D__SAM__ -DSCCZ80 -IC:\PROGRA~1\z88dk\include  h
ello.c C:\Users\Steve\AppData\Local\Temp\s5os_.i
sccz80    -//  C:\Users\Steve\AppData\Local\Temp\s5os_.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 < C:\Users\Steve\AppData\Local\Temp\s5os_.
asm > C:\Users\Steve\AppData\Local\Temp\s5os_.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 < C:\Users\Steve\AppData\Local\Temp\s5os_.
op1 > C:\Users\Steve\AppData\Local\Temp\s5os_.opt
copy C:\Users\Steve\AppData\Local\Temp\s5os_.opt hello.opt
Access is denied.
        0 file(s) copied.
Couldn't copy output files

C:\Program Files\z88dk\examples\sam>
It's having some weird access problems trying to copy things out of the temporary folder. I'm not convinced that it's even managing to create those files in the temporary folder in the first place. If I do the same again with -O0 on the command line, it skips the copt step but still fails to play nicely with the temporary folders. I've tried setting the environment paths to point to other Temp folders (the C:\Users\Steve\AppData\Local\Temp\ just seems to have been the default), but I'm not having any better luck with those folders either.

What am I doing wrong?
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

There's a couple of flags you can play around with to try and figure out what's going on:

-no-cleanup - This will not remove files from the temp directory
-notemp - Create all intermediate files in the current directory

I've not got access to a vista box so I can't try this out myself.
ElectroDruid
New member
Posts: 3
Joined: Sun Oct 12, 2008 6:30 pm

Post by ElectroDruid »

Okay, zcc is definitely writing files, having tried those flags. It's still being rather odd though. Here are the outcomes of trying both with and without the -a flag, with -no-cleanup and -notemp.

Executable, with -no-cleanup. No errors (it doesn't try to copy from the temp folder), and it successfully writes 8 files to the temp folder.

Code: Select all

C:\Program Files\z88dk\examples\sam>zcc +sam hello.c -o hello -no-cleanup
copy C:\PROGRA~1\z88dk\lib\sam_crt0.opt C:\Users\Steve\AppData\Local\Temp\s5i8_1
.opt
        1 file(s) copied.
copy C:\Users\Steve\AppData\Local\Temp\s5i8_1.opt C:\Users\Steve\AppData\Local\T
emp\s5i8_1.asm
        1 file(s) copied.
zcpp -I. -DZ80 -DSMALL_C -DSAM -D__SAM__ -DSCCZ80 -IC:\PROGRA~1\z88dk\include  h
ello.c C:\Users\Steve\AppData\Local\Temp\s5i8_.i
sccz80    -//  C:\Users\Steve\AppData\Local\Temp\s5i8_.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 < C:\Users\Steve\AppData\Local\Temp\s5i8_.
asm > C:\Users\Steve\AppData\Local\Temp\s5i8_.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 < C:\Users\Steve\AppData\Local\Temp\s5i8_.
op1 > C:\Users\Steve\AppData\Local\Temp\s5i8_.opt
z80asm -eopt -ns -Mo C:\Users\Steve\AppData\Local\Temp\s5i8_.opt
z80asm -a -m -Mo -ohello -iC:\PROGRA~1\z88dk\lib\clibs\ndos  -iC:\PROGRA~1\z88dk
\lib\clibs\sam_clib  -iC:\PROGRA~1\z88dk\lib\clibs\z80_crt0  C:\Users\Steve\AppD
ata\Local\Temp\s5i8_1.opt C:\Users\Steve\AppData\Local\Temp\s5i8_.o
Executable, with -notemp. Gives an error and creates no files anywhere

Code: Select all

C:\Program Files\z88dk\examples\sam>zcc +sam hello.c -o hello -notemp
copy C:\PROGRA~1\z88dk\lib\sam_crt0.opt crt0.opt
Access is denied.
        0 file(s) copied.
Cannot copy crt0 file
Assembly (-a) flag, with -no-cleanup. Gives an error copying stuff, but leaves 4 files in the temp folder

Code: Select all

C:\Program Files\z88dk\examples\sam>zcc +sam hello.c -o hello -no-cleanup -a
zcpp -I. -DZ80 -DSMALL_C -DSAM -D__SAM__ -DSCCZ80 -IC:\PROGRA~1\z88dk\include  h
ello.c C:\Users\Steve\AppData\Local\Temp\s1mc_.i
sccz80    -//  C:\Users\Steve\AppData\Local\Temp\s1mc_.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 < C:\Users\Steve\AppData\Local\Temp\s1mc_.
asm > C:\Users\Steve\AppData\Local\Temp\s1mc_.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 < C:\Users\Steve\AppData\Local\Temp\s1mc_.
op1 > C:\Users\Steve\AppData\Local\Temp\s1mc_.opt
copy C:\Users\Steve\AppData\Local\Temp\s1mc_.opt hello.opt
Access is denied.
        0 file(s) copied.
Couldn't copy output files
Assembly (-a) flag, with -notemp. No errors, and it writes 4 files, although it writes them to the Temp folder rather than to the same folder as the source, which is odd.

Code: Select all

C:\Program Files\z88dk\examples\sam>zcc +sam hello.c -o hello -notemp -a
zcpp -I. -DZ80 -DSMALL_C -DSAM -D__SAM__ -DSCCZ80 -IC:\PROGRA~1\z88dk\include  h
ello.c C:\Users\Steve\AppData\Local\Temp\s378_.i
sccz80    -//  C:\Users\Steve\AppData\Local\Temp\s378_.i
copt C:\PROGRA~1\z88dk\lib\z80rules.2 < C:\Users\Steve\AppData\Local\Temp\s378_.
asm > C:\Users\Steve\AppData\Local\Temp\s378_.op1
copt C:\PROGRA~1\z88dk\lib\z80rules.1 < C:\Users\Steve\AppData\Local\Temp\s378_.
op1 > C:\Users\Steve\AppData\Local\Temp\s378_.opt
It seems like it's a problem with Vista not allowing zcc to write to the directory where the source file is compiled from (some kind of "security feature", no doubt), although I'm a bit confused as to why -a -notemp still results in files being written to the temp folder...
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

I'm not sure what's going on with the crt0 file being copied across on -notemp.

As you concluded, it looks like there's a problem writing to the installed z88dk directory, so if you copy the examples to one of your directories I'm guessing it works?
ElectroDruid
New member
Posts: 3
Joined: Sun Oct 12, 2008 6:30 pm

Post by ElectroDruid »

It doesn't look like the crt0 is getting copied to the temp directory, looks like it's getting created there in the first place, even though I've told it not to. Strange.

Yes, I managed to get this compiling from another directory in the end, although Vista fought me over folder permissions every step of the way :/ Thanks for helping me track down the problem. I can't get the compiled hello world binary to actually run in the emulator, but I guess that's a different problem...
Post Reply