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