Sorry for being pedantic, but it looks like you have a Linker error and not a Compiler error.
I don't know Fortran. But I know Microsoft licensed out their Linker tool for other language compiler and development tools makers to use in the past (don't know about now). People accused/criticised Microsoft abusing its dominant position in the x86-based desktop with Windows and Office but without the Linker tool from Microsoft, one can't create an executable regardless if the programming language is Fortran, C/C++, assembly or any other; unless the language development tool provider write their own Linker.
So assuming it is a Microsoft Linker, this is the error message
The Fortran compiler would produce the same object file format for the Linker to recognise it. What you could try is to not use the incremental linking as suggested. I don't know if Compaq Fortran tool provides you that option (i.e. turn off incremental linking). With a Visual Studio C/C++ project a "Rebuild All" pretty much guarantees incremental linking will not be used as it will wipe out the target executable file and all source files will be re-compiled and new object files created. Incremental linking is a feature meant to save time and CPU cycles in creating an executable from the object files and input libraries.
Another possibility is that you might have a corrupt virtual disk, which could possibly explain why the Linker is throwing an error. So you might want to run chkdsk on the XP VM.
You also want to check if there is enough free disk space left in the virtual hard disk and/or in the %TEMP% or %TMP% folders of the Windows XP VM. Build processes can create a lot of temporary files. And sometimes folders/directories such as %TEMP% that has too many files can also lead to strange errors in application execution even though there is plenty free disk space.
I can't explain why the compile/link build process is fine with VirtualBox while in VMware it fails (unless the VirtualBox VM didn't have any existing object files and the linker did not execute an incremental link to create the executable or the VM does not have a disk space issue); then the question comes whether they are running on the same host machine.
Are you still using the host machine as back in January 2014 and as now? What is the CPU (then and now)? What is the version of VMware (then and now)?
Thanks for the quick reply, bluefirestorm.
When I compile a simple program, the problem is only discovered when I run the executable - "Program too big to fit in memory". When I recompile a more complicated program, where I link to my own library (which I also recompile), it says my library may be corrupt. It reports a link problem (LNK1123). This suggests that something is amiss before the linking process.
I already looked at incremental linking (that same link), although I was using the Rebuild All option. It was switched off, but I switched it on and the problem was the same, then switched it back again.
The problem first appeared on my original virtual disk. Then I built a new virtual disk, installing only the Visual Fortran, and the problem was also there. Then I converted a VirtualBox VM (where there was no problem) to a VMWare VM and the problem reappeared. On all VMs, there is plenty of space on the c: drive.
I am using a new desktop PC now, not the one I was using in 2014. However, I am using the same laptop as 2014 and the same problem is there.
My suspicion is that something has changed in VMWare Player, since 2014, that has caused this problem. As the problem occurs on my old VM, where Digital Fortran was already installed, it is not the install process. So, I am flummoxed!
Following extensive tests on old versions of VMWare Player and old versions of VMWare Tools, I have found that the link problem only arises if I am using a Visual Fortran workspace on a shared network drive (including usb drives formatted NTFS or FAT32). If I copy the complete Visual workspace to the local c: drive on the VM, it compiles and links with no problem. Then I just synchronise the local workspace with the workspace on the shared network drive.
So it seems that this is not a problem with the linker as such but with VMWare's connection to shared drives and folders.