OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Harvey on February 06, 2021, 04:27:23 pm

Title: Compile os2 c code to Linux looking for someone with expertise
Post 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
Title: Re: Compile os2 c code to Linux looking for someone with expertise
Post by: Dave Yeo on February 06, 2021, 05:35:37 pm
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.
Code: [Select]
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.
Title: Re: Compile os2 c code to Linux looking for someone with expertise
Post by: Harvey on February 06, 2021, 06:51:08 pm
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
Title: Re: Compile os2 c code to Linux looking for someone with expertise
Post by: Harvey on February 06, 2021, 07:47:06 pm
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

Title: Re: Compile os2 c code to Linux looking for someone with expertise
Post by: Dave Yeo on February 06, 2021, 07:52:19 pm
Try commenting out the include <conio.h> and see what errors you get. Doesn't seem needed here on OS/2
Title: Re: Compile os2 c code to Linux looking for someone with expertise
Post by: Harvey on February 09, 2021, 05:45:35 pm
David

I did edit the c file, there are still one or two comments that are needed.

See psplinux2.c
Title: Re: Compile os2 c code to Linux looking for someone with expertise
Post by: Harvey on February 09, 2021, 06:31:43 pm
Not sure it uploaded
Title: Re: Compile os2 c code to Linux looking for someone with expertise
Post by: Harvey on March 15, 2021, 10:14:14 pm
Need help preparing this c code to compile on Linux
Title: Re: Compile os2 c code to Linux looking for someone with expertise
Post by: Harvey on March 17, 2021, 12:30:45 pm
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)