OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Harvey on February 06, 2021, 04:27:23 pm
-
Have some c code compiled for os2. I would like to prepare the c code to compile with gcc compiler on Linux. Looking for some expertise.
snowbird
-
Looks mostly portable except the include dos.h and the use of delay(), replacing delay() with sleep() and removing all the CTRL-Z's makes the OS/2 GCC happy and may work on Linux.
H:\tmp>pspltlinux.exe
PSPLTOS2, copyright May 13, 2003, Dr. Gerald N. Johnson
Needs, PSPLTOS2 forecast.fil command.fil
"gcc pspltlinux-c " to test. I can try rebooting and testing later. It may need the file opening adjusted and possibly forecast.fil and command.fil need their line endings adjusted.
-
Dave
Thank you
I am having difficulty downloading the pspltlinux.c file . Can you email or to me?
I have two other c programs I need help on....if there is a fee just let me know please
snowbird
-
I was able to download pspltlinux.c.
I tried gcc -o pspltlinux pspltlinux.c -lm
pspltlinux fatal error: conio.h No such file or directory
#include <conio.h>
ls conio.h
conio.h
-
Try commenting out the include <conio.h> and see what errors you get. Doesn't seem needed here on OS/2
-
David
I did edit the c file, there are still one or two comments that are needed.
See psplinux2.c
-
Not sure it uploaded
-
Need help preparing this c code to compile on Linux
-
I am finding errors in expected expressions with these line numbers...
expected expression....
21617.........while (gjfgets (inline, 256, radar_main_fi) != NULL)
21620........(stristr (inline, “max”) != NULL)
21622........(stristr (inline, “min”) ! = NULL)
21628........latitude = atof( inline),
21629.........place = afterwhitespace (inline);
Too few arguments to function
1404..........char *(gjfgets) (char *buf, int n, struct GJFILE *str)
21620........char *stristr ( char *s, char *t)