If you've installed OpenWatcom using "installation disks," I don't
know what that means. Did you download the compiler from the
OpenWatcom website and install from that? For myself, I'm using the
OpenWatcom as we provide it in the distribution.

I'm not sure why "wcc prova.c" then "wcl prova.obj" works, but "wcl -c
prova.c" then "wcl prova.obj" does not. The "-c" option means "compile
only."

This is very odd. I wonder if there's something in the DOS
environment? Probably not, but worth checking. (When I compile on
FreeDOS, I only set the environment variables that I need. I run
OWSETUP.BAT to set up my OpenWatcom environment, and I compile with
that.)

At least, something is happening in the object file, or at least in
the link stage.


Here's my test. I started by creating a new test file:

D:\TEMP>edlin prova.c
prova.c: New file.
*i
 : #include <stdio.h>
 :
 : int main()
 : {
 :   puts("Hello world");
 :   return 0;
 : }
 : .
*w
prova.c: 7 lines written
*q
Really quit (Y/N)? y


In my OWSETUP, I have this line to not have the DOS extender print anything:

set DOS4G=quiet


Then I compile like you did:

D:\TEMP>wcl -c prova.c
Open Watcom C/C++16 Compile and Link Utility Version 1.9
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
        wcc PROVA.C
Open Watcom C16 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
PROVA.C: 7 lines, included 771, 0 warnings, 0 errors
Code size: 15


And then link like you did:

D:\TEMP>wcl prova.obj
Open Watcom C/C++16 Compile and Link Utility Version 1.9
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
        wlink @__wcl__.lnk
Open Watcom Linker Version 1.9
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
loading object files
searching libraries
creating a DOS executable

On Sun, Nov 10, 2024 at 2:02 PM Davide Erbetta via Freedos-user
<freedos-user@lists.sourceforge.net> wrote:
>
>
> Hi Jim!
>
> thanks for your prompt reply!
>
> Even if I remember I've seen .ERR files in my tests last week, in the
> test I've just did any .ERR file has been created, so I cannot send
> those to you; last week I've probably used the OW installation from
> FDIMPLES while now I'm using the OW via installation disks, but it
> should not make any difference. I'll maybe try in the next days to
> delete the current OW installation and install back from FDIMPLES.
>
> Nevertheless I've seen something interesting in the tests I've just done
> after your email.
>
> For any reason, if I use:
>
> 1) "wcl -c prova.c" then "wcl prova.obj" return E3146 "invalid object file"
>
> 2) "wcl prova,c" return E3033
>
> 3) "wcc prova.c" then "wcl prova.obj" it works fine! I've tried several
> times, mixing the test order with 1) and 2) and it always worked! So,
> I've tested this combination also with other C files and it works as
> well, while "wcl file.c" doesn't.
>
> So, even if it's not clear to me what's wrong with 1) and 2), as soon as
> 3) seems to work I'll try to use it. You've been so kind, so I don't
> want to bother you more; thanks a lot for your help!
>
> Regards,
>
> Davide
>
>
> Il 10/11/24 19:02, Jim Hall via Freedos-user ha scritto:
> > Hi Davide!
> >
> > I copied/pasted exactly what you provided as your sample in your
> > email. I saved it as davide.c in my D:\TEMP directory, and then
> > compiled it using OpenWatcom. Using 'wcl -c' means "compile only" and
> > you can do the same thing with just 'wcc' so that's what I did. It
> > works fine on my end:
> >
> >
> > D:\TEMP>wcc davide.c
> > Open Watcom C16 Optimizing Compiler Version 1.9
> > Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
> > Source code is available under the Sybase Open Watcom Public License.
> > See http://www.openwatcom.org/ for details.
> > davide.c: 7 lines, included 771, 0 warnings, 0 errors
> > Code size: 19
> > and:
> >
> > D:\TEMP>wcl davide.obj
> > Open Watcom C/C++16 Compile and Link Utility Version 1.9
> > Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
> > Source code is available under the Sybase Open Watcom Public License.
> > See http://www.openwatcom.org/ for details.
> >          wlink @__wcl__.lnk
> > Open Watcom Linker Version 1.9
> > Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
> > Source code is available under the Sybase Open Watcom Public License.
> > See http://www.openwatcom.org/ for details.
> > loading object files
> > searching libraries
> > creating a DOS executable
> > <<<
> >
> > and then:
> >
> > D:\TEMP>davide
> > prova
> > <<<
> >
> >
> > Your error message includes "directive error near 'ç'" which suggests
> > there's an extra character in your file somewhere. But that doesn't
> > make sense, because you said it compiled fine.
> >
> > Try taking out the "compile only" step and just compile an EXE from
> > your source. Here's what I did:
> >
> > First, I cleaned up:
> >
> > D:\TEMP>del davide.exe
> > one file removed.
> > D:\TEMP>del davide.obj
> > one file removed.
> > <<<
> >
> > ..then I compiled it all in one step:
> >
> > D:\TEMP>wcl -q davide.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
> > <<<
> >
> >
> >
> > You should also have a file named the same as your program, but ending
> > with an ERR extension. That will have a complete copy of the
> > OpenWatcom compiler error or errors. Can you share that ERR file here?
> >
> >
> > On Sun, Nov 10, 2024 at 11:17 AM Davide Erbetta via Freedos-user
> > <freedos-user@lists.sourceforge.net> wrote:
> >>
> >> Hi all,
> >>
> >> I'm new in this mailing list so I apologize if I'm not using it in the
> >> correct way.
> >>
> >> I'm reading the "Writing FreeDOS Programs in C" tutorial from FreeDOS
> >> website by I'm stuck in the "Part 8. Console Programming (conio)".
> >>
> >> On a brand new FreeDOS installation, whatever I install OpenWatcom from
> >> fdimples or through the OpenWatcom installation program, I cannot
> >> compile even a simple C program because I always get the following error
> >> from the linker:
> >>
> >> Error! E3033: file __wcl__.lnk: line(1): directive error near 'ç'
> >>
> >> Before using the "wcl" command I've setup the environment with the
> >> proper BAT file as request. If I split the process using first "wcl"
> >> with "-c" option (e.g.: "wcl -c prova.c") I get the OBJ file
> >> ("prova.obj") apparently with no error, but when I move ahead with "wcl"
> >> command and the obj file it return that the obj file is not a correct
> >> object file ("wcl prova.obj").
> >>
> >> The C code I'm using for testing is very simple, it's just an "hello
> >> world" program that I16GCC has no problem to compile, here it is:
> >>
> >> -------------
> >>
> >> #include <stdio.h>
> >>
> >> int main()
> >> {
> >>       printf("prova");
> >>       return 0;
> >> }
> >>
> >> -------------
> >>
> >> Thanks if anyone has a guess on how to solve this issue.
> >>
> >> Best regards,
> >>
> >> Davide
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> Freedos-user mailing list
> >> Freedos-user@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/freedos-user
> >
> > _______________________________________________
> > Freedos-user mailing list
> > Freedos-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/freedos-user
>
>
> _______________________________________________
> Freedos-user mailing list
> Freedos-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-user


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

Reply via email to