Author Topic: Compile os2 c code to Linux looking for someone with expertise  (Read 7146 times)

Harvey

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Compile os2 c code to Linux looking for someone with expertise
« 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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Compile os2 c code to Linux looking for someone with expertise
« Reply #1 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.

Harvey

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Compile os2 c code to Linux looking for someone with expertise
« Reply #2 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

Harvey

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Compile os2 c code to Linux looking for someone with expertise
« Reply #3 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


Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Compile os2 c code to Linux looking for someone with expertise
« Reply #4 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

Harvey

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Compile os2 c code to Linux looking for someone with expertise
« Reply #5 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

Harvey

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Compile os2 c code to Linux looking for someone with expertise
« Reply #6 on: February 09, 2021, 06:31:43 pm »
Not sure it uploaded

Harvey

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Compile os2 c code to Linux looking for someone with expertise
« Reply #7 on: March 15, 2021, 10:14:14 pm »
Need help preparing this c code to compile on Linux

Harvey

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Compile os2 c code to Linux looking for someone with expertise
« Reply #8 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)