On Mon, Nov 11, 2024 at 11:47 AM Davide Erbetta <davide.e1...@gmail.com> wrote:
>
>
> Hi Jim,
>
> let me first say that I'm using FreeDOS in VirtualBox. I've made a fresh
> new install of FreeDOS and OW from the FreeDOS distribution CD as suggested.
>
> I had the C file ("prova.c) on A: drive, an IMG file attached as A:
> drive. On this IMG file on A: I had no issue in writing, compiling with
> i16gcc, etc. I had the doubt that this (C file on "diskette" - IMG file
> as A:) could be the source of the error, so I've made the following.
>
> I copied the C file on C: drive as well and I did the tests:
[..]

This is a very weird problem, I cannot replicate it on my end. For
what it's worth, I boot FreeDOS in QEMU on Linux -- but the virtual
machine shouldn't matter here, because you say you can compile fine
using IA-16 GCC.

Here's what I did:

First, I defined a new 720k floppy disk image and booted my QEMU
instance with it (as the "A:" drive). I also formatted it as a 720k
floppy.

And I created a hello.c file on the A: drive:

A:\>dir /b
HELLO.C

A:\>type hello.c
#include <stdio.h>

int main()
{
  puts("Hi there!");
  return 0;
}

I also copied the hello.c file to the C: drive, at the root: (I used a
slightly different name so it was always clear which program file was
which)

C:\>copy A:\hello.c hello2.c
A:\hello.c =>> hello2.c


Then I reproduced your steps:


>
> 1) from C: I've run "wcl prova.c" --> it works!
>


This also works for me:

C:\>wcl -q hello2.c
DOS/4GW Protected Mode Run-time  Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW Protected Mode Run-time  Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

C:\>hello2
Hi there!


> 2) from C: I've run "wcl a:\prova.c" --> it works!


That works for me too:

C:\>wcl -q A:\hello.c
DOS/4GW Protected Mode Run-time  Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW Protected Mode Run-time  Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

Note that this creates the hello.obj and hello.exe in the current
directory on the C: drive, so you have to run it there:

C:\>dir /b hello.*
HELLO.EXE
HELLO.OBJ

C:\>hello
Hi there!


> 3) from A: I've run "wcl prova.c" (what I've done in the last days) -->
> ERROR!


I don't get the error. This step works for me:

A:\>wcl -q hello.c
DOS/4GW Protected Mode Run-time  Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW Protected Mode Run-time  Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

A:\>hello
Hi there!


> 4) from A: I've run "wcl c:\prova.c" --> ERROR!


I still don't get this error. This step works for me. Note that
compiling a file in another drive or directory will create the output
file in the current directory, so I was able to run the output in the
current directory:

A:\>wcl -q C:\hello2.c
DOS/4GW Protected Mode Run-time  Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW Protected Mode Run-time  Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994

A:\>hello2
Hi there!


[..]
> (while if I run "wcc prova.c" + "wcl prova,obj" it always works, from A:
> or C:)
>
> So it looks like if I run "wcl" from A: it has issue. I don't know why,
> but I hope it helps.

I assume the comma in your above command is a typo? You wrote "wcl
prova,obj" but that should be "wcl prova.obj"



I think the only way to figure this out is for you to share your
OWSETUP.BAT file (in case it was edited) and your PATH variable, and
copy/paste the exact messages you see when compiling. See above: When
I show my examples, I'm literally copying & pasting the output of the
commands into this email. I think "ERROR" is not a good enough
description, we need to see the actual output text.

For example, here is my OWSETUP.BAT (I edited it to add an alias to
FED and LS, and turn off output messages with DOS4G .. although I
"un-set" the DOS4G variable before I ran any of these commands)

C:\DEVEL\WATCOMC>type owsetenv.bat
@echo off

if "%WATCOM%" == "" goto SetEnv
if not exist %DOSDIR%\BIN\VFDUTIL.COM goto SetEnv
VFDUTIL /T WFC.EXE /T WFL.EXE
if errorlevel 1 goto SetEnv
goto End

:SetEnv
echo Open Watcom C/C++ Build Environment
SET PATH=C:\DEVEL\WATCOMC\BINW;%PATH%
SET INCLUDE=C:\DEVEL\WATCOMC\H;%INCLUDE%
SET WATCOM=C:\DEVEL\WATCOMC
SET EDPATH=C:\DEVEL\WATCOMC\EDDAT
SET WIPFC=C:\DEVEL\WATCOMC\WIPFC

:End

echo ON

set DOS4G=quiet
alias LS=DIR /O:GNE /W/B/L
alias FED=C:\apps\fed\fed.exe



And here is the PATH variable after I run OWSETUP.BAT:

C:\DEVEL\WATCOMC>path
PATH=C:\DEVEL\WATCOMC\BINW;C:\FreeDOS\BIN


_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to