Author Topic: Compiling the WPS CAR Sample from OS2TK45  (Read 6645 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Compiling the WPS CAR Sample from OS2TK45
« on: November 30, 2016, 10:38:12 pm »
Hi

I'm trying to learn how to compile a WPS class sample. So I think it can be a good idea to try to compile the CAR sample of the OS2TK45.

I just installed the OS2TK45 from the eCS 2.1 CD#2 with the sames without registering the classes.

My goal is only to generate the CAR.DLL for this samples. I checked the WPS Programming Guide, but I haven't found the info con how to compile the CAR sample, it just explain what it does.

Can someone please point me which should be steps to generate CAR.DLL with the OS2TK45?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

ak120

  • Guest
Re: Compiling the WPS CAR Sample from OS2TK45
« Reply #1 on: December 01, 2016, 01:11:41 am »
Simply start a command prompt of your C environment. IBM C Set++ for OS/2 should be enough, for later toolkit versions VisualAge C++ 3.0 is default. If not already set by CONFIG.SYS add the environment variables from toolkit installation to your C environment startup script - especially the SOMobjects Toolkit settings. Change to the directory of the sample and run nmake.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling the WPS CAR Sample from OS2TK45
« Reply #2 on: December 01, 2016, 12:51:24 pm »
Hi Andreas.

Can it be possible to do it with gcc instead of Set++ or Visualage, or there is no way to do it.

I have installed the OS/2 Toolkit so I have sc.exe and nmake. I guess the way to call the compilation with nmake is "nmake car.mak". Am I right?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

ak120

  • Guest
Re: Compiling the WPS CAR Sample from OS2TK45
« Reply #3 on: December 01, 2016, 03:25:06 pm »
Can it be possible to do it with gcc instead of Set++ or Visualage, or there is no way to do it.
Latest OS/2 Toolkit only supports ICC (from VisualAge C++ 3.0) out of the box.
It depends on version of GCC and your environment. The macros need to be changed of course.

Quote
I have installed the OS/2 Toolkit so I have sc.exe and nmake. I guess the way to call the compilation with nmake is "nmake car.mak". Am I right?
nmake -f car.mak

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling the WPS CAR Sample from OS2TK45
« Reply #4 on: December 01, 2016, 03:51:41 pm »
Since I don't have icc.exe installed yet the error is kind of obvious.

Quote
[C:\Projects\CAR]nmake -f car.mak

Operating System/2 Program Maintenance Utility
Version 4.00.001 Oct  4 2001
Copyright (C) IBM Corporation 1988-2001
Copyright (C) Microsoft Corp. 1988-1991
All rights reserved.

        sc -p -mnotc -maddstar -mnoint -S128000 -C128000 -s"def"  car.idl
        sc -p -mnotc -maddstar -mnoint -S128000 -C128000 -s"ih"   car.idl
        sc -p -mnotc -maddstar -mnoint -S128000 -C128000 -s"h"    car.idl
        icc -c -Gd- -Se -Re -Ss -Ms -Gm+  -Ge- -I. -Fo".\car.obj" car.c
SYS1041: The name icc is not recognized as an
internal or external command, operable program or batch file.
NMAKE : fatal error U1077: 'C:\OS2\CMD.EXE' : return code '1041'
Stop.

The other things that called my attention is that the make file of the sample called "ibmsamp.inc".

I would like to try to follow the procedure without the make file to learn which are to common steps on compiling a SOM application. 

And if GCC can also be used it will be great.  It can be interesting to know how to replace "icc -c -Gd- -Se -Re -Ss -Ms -Gm+  -Ge- -I. -Fo".\car.obj" car.c" with gcc..

I'm using the latest gcc included on the RPM/YUM repo.  (2-01-2015  2:08p       337,172  /   4.9.2.1-3)

Regards
« Last Edit: December 01, 2016, 04:04:54 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

RickCHodgin

  • Guest
Re: Compiling the WPS CAR Sample from OS2TK45
« Reply #5 on: December 01, 2016, 05:02:29 pm »
I think you can download here https://archive.org/details/VisualAgeForCVer4.0OS2.

I recommend getting it to work with anticipated tools, and then if you want to switch to gcc do it in steps manually from the command line.  You'll need details about what each command line switch does, and there may be some OS/2 compiler quirks gcc doesn't yet support.

Best regards,
Rick C. Hodgin

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling the WPS CAR Sample from OS2TK45
« Reply #6 on: December 01, 2016, 06:37:21 pm »
Or if someone knows an easier WPS Class sample that will compile on gcc just to learn the procedure I will appreciate it.

I don't want just to install VAC and run the make file, I will like to learn a little bit more about the procedure to compile a WPS class. The objective may be to have a CAR.DLL compiled, but I always want to learn the journey to get there.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

ak120

  • Guest
Re: Compiling the WPS CAR Sample from OS2TK45
« Reply #7 on: December 01, 2016, 07:28:29 pm »
Quote
The other things that called my attention is that the make file of the sample called "ibmsamp.inc".
That's not a make file.

Quote
I would like to try to follow the procedure without the make file to learn which are to common steps on compiling a SOM application.
So you need first the right development environment.

Quote
And if GCC can also be used it will be great.  It can be interesting to know how to replace "icc -c -Gd- -Se -Re -Ss -Ms -Gm+  -Ge- -I. -Fo".\car.obj" car.c" with gcc..
You need to follow the documentation included with GCC/EMX. And it's not only about the compiler but also the linking process.

Quote
I'm using the latest gcc included on the RPM/YUM repo.  (2-01-2015  2:08p       337,172  /   4.9.2.1-3)
I cannot find any documentation about it, so it's something for freaks. Better use Borland C++ or OpenWatcom C/C++ if you cannot install IBM VisualAge C++ 3.0.