Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

f1042 error during compile

Status
Not open for further replies.

joeyc100

Programmer
Feb 1, 2011
14
0
0
US
I get an f1042 error during a compile running under Win7x64 with NTVDMx64 installed:

E:\DECBAL>FL /FPi /c /Fs DECBAL.FOR
Microsoft (R) FORTRAN Optimizing Compiler Version 4.00
Copyright (c) Microsoft Corp 1987. All rights reserved.

DECBAL.FOR
fatal error C1042: cannot open compiler intermediate file - no such file or directory

error 2001: Null pointer assignment
fatal error F1042: cannot open compiler intermediate file - no such file or directory

Any ideas?
Both MASM and LINK work, as well as binarys which have been compiled elsewhere and ported.
 
see here:
Code:
C1042                             cannot open compiler intermediate file -
                                    no such file or directory

                                    The compiler could not create
                                    intermediate files for use in the
                                    compilation process because the TMP
                                    environment variable was set to an
                                    invalid directory or path.

So check your environment variable TMP, maybe it was set to a nonexistent directory, or it was not set at all.
 
TMP E:\FORTRAN and LIB E:\FORTRAN
were set in the Environment Variables.
Joe.
 
I found this version of Microsoft Fortran installed it on DOSBox and it seems to works for me.

I tried to compile a little HELLO.FOR program with the compiler options you provided and FL created HELLO.OBJ and HELLO.LST

Screenshot_at_2023-04-08_12-09-59_p6vtxd.png


I used this environment setting:
Code:
PATH C:\;C:\BIN
SET TMP=C:\TMP
SET LIB=C:\LIB
 
Thanks.
DOSBOX does not handle the parallel port. I can't use it for some of my programs, so I don't bother with it at all.
I will check out the link you gave.
Repeating: the Fortran 4.1 version that I have works perfectly under Windows 7x86, but does not work under Windows 7x64
I have checked out the link and downloaded Fortran 5.1 to try it. The files are in .img format show an error when I try to burn them to a CD using either IMGBURN or Windows burn. I no longer have floppy disc capability.
Joe.
 
As for DOSBox, maybe you can use DOSBox-X which is enhanced version of DOSBox and has support for printers - see:
As for the IMG files you can rename them to ZIP and then extract.
For example for MS Fortran 5.1 which i downloaded from this link
i renamed the files disk1.img, .., disk6.img into disk1.zip, .., disk6.zip and then extracted them into directories disk1, .., disk6
Code:
C:\INSTALL\MSFOR51>dir

 Volume in drive C has no label
 Volume Serial Number is 0000-1234
 Directory of C:\INSTALL\MSFOR51

.              <DIR>            04/09/2023  4:14a
..             <DIR>            04/09/2023  4:16a
DISK1          <DIR>            04/09/2023  4:11a
DISK2          <DIR>            04/09/2023  4:12a
DISK3          <DIR>            04/09/2023  4:12a
DISK4          <DIR>            04/09/2023  4:13a
DISK5          <DIR>            04/09/2023  4:13a
DISK6          <DIR>            04/09/2023  4:14a
FORDOC   ZIP            272,246 12/15/2014 10:51p
WINWOR~1 TXT                691 12/15/2014  1:20a
    2 File(s)           272,937 Bytes
    8 Dir(s)           393.19 G Bytes free

C:\INSTALL\MSFOR51>
Then I changed into C:\INSTALL\MSFOR51\DISK1 and started installation with SETUP.EXE.
During the installation all other necessary directories DISK2, .., DISK6 were found automatically.
After the installation the file with environment settings was created
C:\FORTRAN\BIN\NEW-VARS BAT
ksnip_20230409-052118_n9fzrl.png

which contains proper environment settings:
Code:
SET PATH=C:\FORTRAN\BIN\;C:\FORTRAN\BINB\;Z:\;Z:\SYSTEM;Z:\BIN;Z:\DOS;Z:\4DOS;Z:\DEBUG;Z:\TEXTUTIL
SET LIB=C:\FORTRAN\LIB
SET INCLUDE=C:\FORTRAN\INCLUDE
SET HELPFILES=C:\FORTRAN\HELP\*.HLP
SET INIT=C:\FORTRAN\INIT
SET TMP=C:\FORTRAN\BINB
It need be executed before running the FL compiler.
 
@joeyc100:
Did you manage to unpack the IMG files and install the MS Fortran compiler?
 
DOSBOX X just allows for printer output. I need full access to the bidirectional parallel port for read/write data, write control, and read status/sense. I have found the windows driver Inpout.sys for /windows/system32/drivers and a c++ program to read/write lpt1 directly in windows7, so I will go that way.
But I still want to use 16 bit programs in 64bit windows, and want to see if Fortran 5.1 will work.
I don't know how to unpack the renamed .zip files. Windows will not do it, claiming the files are defective, and I don't know any MSDOS command.

 
For unpacking IMG files try to use 7-zip
- see here: Other option could be WinImage
- see here: But 7-zip is freeware.

I unpacked the IMG files with Archive Manager on Linux.

Unfortunately I can't help you with Windows 7 problems because I don't have it anymore.
I'm currently using only Linux and Windows 10.
 
Never mind. I unpacked with 7-ZIP and installed Fortran 5.1.
I'll try it tomorrow.
Thanks for all your help.
Joe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top