OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Martin Iturbide on December 03, 2018, 05:54:40 pm

Title: Compiling my first WPS application
Post by: Martin Iturbide on December 03, 2018, 05:54:40 pm
Hi

I always want to learn something when time allows it, and I want to follow the procedure to compile a WPS application and maybe write something quick about it for the EDM/2 wiki.

I only want to learn the "compiling/linking" procedure. So I want to grab some working source code and as a goal I want to produce the DLL with the WPS program (class).

I was thinking to give it a try to compile Hwman (https://github.com/OS2World/UTIL-WPS-HWMan), but I was wondering if someone suggest some other project or sample.

And I would like to know if I need to install the full VAC++ 3.0 environment, or it is not necessary just to compile the source code.

Regards
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 03, 2018, 06:22:01 pm
And I would like to know if I need to install the full VAC++ 3.0 environment, or it is not necessary just to compile the source code.
It's not required but seems to be the easiest way. Simply install the Toolkit and VisualAge C++ (without toolkit parts) + fixes.
Watcom or other compilers should also work, but you need to change the makefile.
Title: Re: Compiling my first WPS application
Post by: Lars on December 04, 2018, 12:38:23 pm
Hi Martin,

1) while we are at it: you should update your github to the latest HWMan Version 13 source code (which is contained in the WPI). I had to make relevant changes to the source code:
http://hobbes.nmsu.edu/download/pub/os2/util/wps/hwman13.wpi

2) addition to the preceding answer: if you install VAC3, then I suggest that you DO NOT install the IWF (integrated workframe part, the IDE so to say). That thing is so buggy and lousy that you better not use it at all. It's especially buggy and lousy on an SMP system.
HWMAN comes with a makefile (as most other OS/2 source code does) and that's it. It is going to build from a commandline.

Title: Re: Compiling my first WPS application
Post by: André Heldoorn on December 04, 2018, 01:31:17 pm
It's not required but seems to be the easiest way. Simply install the Toolkit and VisualAge C++ (without toolkit parts) + fixes.

Here: WPS backup, VAC++ 3 CD excluding the toolkit, edit LIBPATH before the reboot (IIRC x:\OS2\DLL before x:\IBMCPP\DLL), reboot and WPS backup, install the first 3.08.x updates with documented reboot, an extra reboot before installing the IIRC 5th package, reboot, install the toolkit v4.52 by using eCS CD #2. And install optional packages like the lvm_toolkit_15.zip, drgdrp.zip and nb-fix.zip.

I do tend to install *.*, including the IDE. If it's buggy, then just don't use it. Probably easier than having to install VAC++ if some project or programming book requires it. Typically you won't use it, for one because of the famous steep learning curve.

Last known location of the english-us FixPaks: ftp://service.software.ibm.com/ps/products/visualagecpp/fixes/v30os2/english-us/fixpak8 (http://ftp://service.software.ibm.com/ps/products/visualagecpp/fixes/v30os2/english-us/fixpak8), IIRC you'll need 8 (6, and 3081, and 3082).
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 04, 2018, 03:02:41 pm
I do tend to install *.*, including the IDE. If it's buggy, then just don't use it. Probably easier than having to install VAC++ if some project or programming book requires it. Typically you won't use it, for one because of the famous steep learning curve.

Last known location of the english-us FixPaks: ftp://service.software.ibm.com/ps/products/visualagecpp/fixes/v30os2/english-us/fixpak8 (http://ftp://service.software.ibm.com/ps/products/visualagecpp/fixes/v30os2/english-us/fixpak8), IIRC you'll need 8 (6, and 3081, and 3082).
Only cto3082.zip should be required for Open Class which incorporates the changes from earlier cto3081.zip. But for this topic it's not important. The latest binaries and locale fixes from ftp://service.software.ibm.com/ps/products/visualagecpp/fixes/v30os2/english-us/tempfix/eurofix/eurofix.zip should be more useful. East Asian locale fixes that don't use the Japanese edition are also available: ftp://service.software.ibm.com/ps/products/visualagecpp/fixes/v30os2/english-us/tempfix/localefx/localefx.zip
Title: Re: Compiling my first WPS application
Post by: Lars on December 04, 2018, 03:37:11 pm
Hi Martin,

1) while we are at it: you should update your github to the latest HWMan Version 13 source code (which is contained in the WPI). I had to make relevant changes to the source code:
http://hobbes.nmsu.edu/download/pub/os2/util/wps/hwman13.wpi

Oh, you already did ...
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 04, 2018, 09:06:11 pm
Thanks for the reply

Lar's which make program do you use to run the makefile? Can you give me a hint on how you call it, I don't have experience with it.

Regards
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 04, 2018, 09:49:17 pm
Try nmake
Title: Re: Compiling my first WPS application
Post by: Lars on December 05, 2018, 02:31:57 pm
Yes, nmake.exe (which is inluded in the OS/2 toolkit but I think it also comes with VAC).

"nmake" to do a normal build
"nmake "DEBUG=1"" to build with debug info
"nmake -a" to rebuild all
"nmake -a "DEBUG=1"" to rebuild all with debug info
Title: Re: Compiling my first WPS application
Post by: André Heldoorn on December 07, 2018, 01:08:39 am
Only cto3082.zip should be required for Open Class which incorporates the changes from earlier cto3081.zip.

The latest binaries and locale fixes from ftp://service.software.ibm.com/ps/products/visualagecpp/fixes/v30os2/english-us/tempfix/eurofix/eurofix.zip should be more useful. East Asian locale fixes that don't use the Japanese edition are also available: ftp://service.software.ibm.com/ps/products/visualagecpp/fixes/v30os2/english-us/tempfix/localefx/localefx.zip

Thanks, installed. If anything to not bother experts with fixed issues. I was using some old mirror directory.

FTR: with eurofix.zip I had to unlock CPPOM30.DLL first, albeit I didn't use the documented -u option of UNZIP.EXE after repackaging eurofix.zip (to use a more clear and constant root directory as a base directory, instead of having to remember to CD to x:\IBMCPP directory).
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 08, 2018, 03:31:10 pm
Hi

Where can I get "emxupd.exe". By any chance it is on the netlabs RPM? or where can it be downloaded?

Regards
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 08, 2018, 04:31:33 pm
Where can I get "emxupd.exe".
Simply from emxrt.zip that is available: http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxrt.zip

Quote
By any chance it is on the netlabs RPM? or where can it be downloaded?
No clue.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 08, 2018, 05:37:18 pm
Where can I get "emxupd.exe". By any chance it is on the netlabs RPM? or where can it be downloaded?

I found it on the emxrt-devel (netlabs RPM) but can not be installed since there is some conflict with other package, so I installed the file manually.

Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 08, 2018, 06:46:01 pm
Hi

So, once I installed the OS2TK45, icc.exe compiler and fixpack 2 I tried to run the make file.

I run "nmake" on the directory where I downloaded the HWman files. I'm attaching the errors I got.
I'm running it from "Command line" environment from the installed "IBM C / C++  Compiler" icon.

It seems that I'm missing RMCALLS.H, Is that on the OS/2 Device Driver Kit, right?

Regards
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 08, 2018, 06:54:34 pm
It seems that I'm missing RMCALLS.H, Is that on the OS/2 Device Driver Kit, right?

Yes, I have it in DDK\base\h and it includes rmbase.h and rmioctl.h and they may include more so you need enough of the DDK to have this.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 08, 2018, 06:57:22 pm
Thanks

I had added the DDK's h and lib directories to the config.sys include and lib path and it seemed to work.

The obj's and DLL file got generated without any error.  So I think the requirements of the compile process is complete.

Regards
Title: Re: Compiling my first WPS application
Post by: Lars on December 08, 2018, 10:16:35 pm
From the build output I conclude that you compiled with VAC 3.6.5 instead of VAC 3.0.
However, it should still work fine.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 09, 2018, 03:39:57 am
Hi Lars

I used:
- icc.exe  - 2000-11-24 12:44a    / 3.6 FP2 / 57,078 bytes
- sc.exe - 1999-06-30 11:12p  / 50,296 bytes
- alp.exe - 2001-05-25 / 4.00.008 / 466,944 bytes
- rc.exe - 2003-01-30 / 5.00.007 / 399,538 bytes  / IBM RC (Resource Compiler) Version 5.00.007 Jan 30 2003
- ilink.exe - 2000-11-24 1:27a    / 03.06.PPK1001120    / 110,247 bytes    /IBM Version. Version 3.6 with Fixpack 2.
- dllrname.exe - 2000-11-24 1:26a / 35,679 bytes / IBM C/C++ Tools Version 2.0 - DLL Rename Utility
- emxupd.exe - 1998-12-19 9:27p   /  34,304 bytes

Those are the latest versions I was able to find. If someone knows about a newer version of these executables please let me know.

Regards
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 09, 2018, 05:51:40 am
Sometimes newer versions are not necessarily better. In particular compilers and linkers have their idiosyncrasies that source code depends on. As well sometimes newer equals more strict. I just recompiled something that was last compiled with GCC 3.35 and had to add casts and make some things const to get rid of errors and warnings. Funny enough, just changing the command line I used, adding a define, caused more errors that were unrelated.
Title: Re: Compiling my first WPS application
Post by: Lars on December 09, 2018, 10:06:03 am
My code is really simple, seems that VAC 3.6.5 swallowed it just as good as VAC 3.0 :-)

In any case, the only reason it would matter is because of this in the makefile:
       dllrname.exe $@ CPPOM30=OS2OM30 /n /q

The makefile is written to link to the (multithreaded) DLL version of the C runtime library. For VAC 3.0, this file is called CPPOM30.DLL. Unfortunately only owners of VAC 3.0 have this file.
But fortunately OS/2 comes with file \OS2\DLL\OS2OM30.DLL which in fact is exactly the CPPOM30.DLL file just renamed (there are legal reasons to this).
The makefile directly renames all references to CPPOM30.DLL to OS2OM30.DLL and therefore allows the use of HWMAN.DLL on every OS/2 system.

For VAC 3.6.5 the C runtime library is called cpprmi36.DLL and therefore this name replacement will not work and users will need to get this file from somewhere in order for HWMAN.DLL to work.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 09, 2018, 04:45:54 pm
Thanks for your comments, it is interesting information for me.

Do you think, as an experiment, that can it be possible to replace icc.exe from the compile procedure and use the gcc.exe compiler that is ported to OS/2 ? Will it be too hard? or a lot of the source code will have to be changed for it to work?

Regards
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 09, 2018, 06:24:35 pm
Do you think, as an experiment, that can it be possible to replace icc.exe from the compile procedure and use the gcc.exe compiler that is ported to OS/2 ?
It should not be a problem to use a C compiler - besides LECs there's no important usage of C++. Simply rename the *.cpp source files to *.c for using gcc. Otherwise it should be possible to use g++ or Watcom C++.

Quote
Will it be too hard? or a lot of the source code will have to be changed for it to work?
Quite simple, take a look at /emx/samples/som_idl/
Title: Re: Compiling my first WPS application
Post by: Lars on December 09, 2018, 08:36:20 pm
Bullshit.
It IS C++ Code. You cannot just rename the files.
You have no clue.
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 09, 2018, 09:27:39 pm
The question is, what are those options being passed to icc.exe? I can't find anything listing them looking quickly in my VACPP 3.08 install, which is installed in eCS rather then the AOS I'm using.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 10, 2018, 05:23:11 am
Hi

Just as part of the exercise I'm trying to use GNU make (from the kbuild-make rpm package) instead of nmake. Just with some little tweaks to the makefile it seems to compile, but it seems it does not take the "DEBUG" options of the make file.

Quote
ifdef DEBUG
   @echo "DEBUG activated"
   AFLAGS=+Od
   CFLAGS=-Ti
   LFLAGS=-de -db -br

else
   @echo "No DEBUG"
   AFLAGS=-Od
   CFLAGS=-O
   LFLAGS=
endif


Maybe someone with more experience with GNU make can give me a hint.

Regards
Title: Re: Compiling my first WPS application
Post by: Lars on December 10, 2018, 12:09:39 pm
https://www.gnu.org/software/make/manual/make.html:

ifdef $(DEBUG)

else

endif

You will then have to invoke make.exe by specifying this variable.
Title: Re: Compiling my first WPS application
Post by: Lars on December 10, 2018, 12:11:30 pm
The question is, what are those options being passed to icc.exe? I can't find anything listing them looking quickly in my VACPP 3.08 install, which is installed in eCS rather then the AOS I'm using.

All compiler options are described in some INF that comes with VAC 3.0. Plus you can run "icc.exe" and it will spit out most if not all of its options.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 10, 2018, 02:04:32 pm
Hi

I'm checking the make manual.

The ifdef is not working. I just include it as:
Quote
ifdef $(DEBUG)
   @echo "DEBUG activated"
   AFLAGS=+Od
   CFLAGS=-Ti
   LFLAGS=-de -db -br

else
   @echo "No DEBUG"
   AFLAGS=-Od
   CFLAGS=-O
   LFLAGS=
endif

but "make DEBUG" just tell me "make: *** No rule to make target `DEBUG'.  Stop.".
If I just run "make" it seems that the ifdef gets ignored.

I also added the "clean" stuff that seems to work.

Regards
Title: Re: Compiling my first WPS application
Post by: Neil Waldhauer on December 10, 2018, 03:33:35 pm
I have used this construction instead:

Code: [Select]
%if !%defined(DEBUG)         # Make sure DEBUG is defined.
    DEBUG=0                  # Default is production
%endif

What you have might work if you include DEBUG=0 on the command line.
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 10, 2018, 03:34:08 pm
The variable DEBUG needs a value.

It would be easier to add a target for this operation to the Makefile.

For example:
Code: [Select]
# GCC Debugging
gcc-deb:
  $(MAKE) -f makefile target \
  CC="gcc -g ..." \
  CFLAGS="-DOS2 -Wall ..." \
  NFLAGS="" \
  DLLFLAG="" \
  AS="gcc -g" \
  ASFLAGS="-Di386" \
  LDFLAGS="-o ./" \
  OUT="-o" \
  ...

Title: Re: Compiling my first WPS application
Post by: Bogdan on December 10, 2018, 03:55:05 pm
Bullshit.
Hej, legendary German politeness (der neu deutsche hoflichkeit) - pasuje.

Quote
It IS C++ Code. You cannot just rename the files.
You have no clue.
Usually the C++ Language System can handle this task. You're right it's not necessary at all, a simple filter should help to avoid file name issues.
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 10, 2018, 04:12:10 pm
The question is, what are those options being passed to icc.exe?
Nothing special. Please look inside "VisualAge C++ Programming Guide" (should be also available in PostScript or INF) sections "Additonal VisualAge C++ Predefined Macros" and "Code Generation Options".

Quote
I can't find anything listing them looking quickly in my VACPP 3.08 install, which is installed in eCS rather then the AOS I'm using.
I don't know the drive letter of your install:
VIEW \IBMCPP\HELP\CPPPROG.INF

alternatywa PDF: http://publib.boulder.ibm.com/pubs/pdfs/as400/V3R7PDF/cpprog00.pdf
Title: Re: Compiling my first WPS application
Post by: Andreas Schnellbacher on December 10, 2018, 04:32:50 pm
Preprocessor conditionals in nmake have a leading exclamation mark. Use '!ifdef', '!else' and '!endif' instead of 'ifdef', 'else' and 'endif'. (I don't know, how your variant behaves, but I always use the '!' terms.)
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 11, 2018, 03:15:43 am
Hi Andreas.

If I use " '!ifdef', '!else' and '!endif'", I get this error "makefile:14: *** missing separator.  Stop."

I also tried with DEBUG = 0 and no change.

Just in case I'm using this "make.exe" from the RPM:
  7-26-17 11:41a       109,437    124 a---  make.exe

Regards.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 11, 2018, 04:17:00 am
This is as close I can get to compile with GNU MAKE.

If I run just "make" it will compile, but there is no way I can make it go inside the "DEBUG" if. It goes always by the "else".

Regards
Title: Re: Compiling my first WPS application
Post by: André Heldoorn on December 11, 2018, 10:41:32 am
I'm checking the make manual.

   CFLAGS=-Ti

FTR: in your MAKEFILE there's a line:

   icc.exe -Q -Sp2 -D__IBMC__ -W2 $(CFLAGS) -Gm -Gd -Ge- -G5 -C $<

Which shows that e.g. the set variable CFLAGS is related to a ICC.EXE command line. "ICC /? | MORE" will probably show that /Ti+ includes debug code, so you can use the VAC debugger with this code.

In Rexx,don't check the Rexx manual, the code could have looked like:

/**/
c='HelloWorld.C'
cflags=''
debug=0
IF debug=1 THEN cflags='/Ti+'
'ICC.EXE -Q -Sp2 -D__IBMC__ -W2' cflags '-Gm -Gd -Ge- -G5 -C' c
Title: Re: Compiling my first WPS application
Post by: Lars on December 11, 2018, 01:37:16 pm
make.exe "DEBUG=1" (no spaces, with surrounding apostrophy)
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 11, 2018, 06:47:03 pm
Hi Lars.

I just tried what you suggested, no errors showed, but the the "ifdef $(DEBUG)" just get ignored.

Regards
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 11, 2018, 08:04:33 pm
...but the the "ifdef $(DEBUG)" just get ignored.
I don't know how old or outdated the used GNU Make version really is. But I would recommend to read at least "Chapter 6: How to Use Variables" and "Chapter 7: Conditional Parts of Makefiles" form the GNU Make manual. ifdef only tests whether a variable has a value.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 11, 2018, 09:30:04 pm
By the way, I'm using GNU Make 3.81 (Built for i386-pc-os2-emx)  (7-26-17 11:41a  - 109,437) It is included on the "kbuild-make" from the netlabs RPM.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 12, 2018, 04:38:44 pm
Hi

Now I want to experiment if I can replace icc.exe with gcc.exe.

Just sending a simple:
  gcc.exe hwman.cpp

gives me this error.
Code: [Select]
[H:\projects\test]gcc.exe hwman.cpp
In file included from hwman.cpp:23:0:
hwman.xih:20:21: fatal error: somcls.xh: No such file or directory
 #include <somcls.xh>
                     ^
compilation terminated.

That is strange since I'm using the same environment variables (for the command line) that I'm using with icc. I also checked that I have that file on OS2TK45 directory (H:\OS2TK45\som\include).

Regards

Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 12, 2018, 06:13:28 pm
GCC uses different variables to find its includes, libs etc.
set C_INCLUDE_PATH=
set CPLUS_INCLUDE_PATH=
set LIBRARY_PATH=

As well as on the command line, -Ipath/to/include/file -Lpath/to/lib/or/a/library.
Make sure you use -Zomf as well, probably both as a CFLAG and LDFLAG.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 12, 2018, 10:54:58 pm
Thanks Dave.

It runs (gcc -Zomf -O hwman.cpp  ) but the quantity of warning and errors is so high that I think that it may not be good to keep trying to use gcc on this experiment.  Is there a way to save the output of the command on a txt file? I'm trying the " | tee out.txt" but the txt file is empty.

Regards
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 12, 2018, 11:03:07 pm
Need to catch standard error too. 2>&1 | tee build.log. Be good to see the errors. Based on some experiments I did the other day, GCC by default is quite picky and I had to add a bunch of unexpected casts, mostly  char to PCSZ.
(edit)
Another thing is that GCC will by default use os2emx.h when including os2.h. To use the toolkit version of os2.h, you have to define USE_TOOLKIT_HEADERS before including os2.h, on the command line -DUSE_TOOLKIT_HEADERS or in the program, #define (USE_TOOLKIT_HEADERS). See @UNIXROOT/usr/include/os2.h
Be interesting to try using the libc version of os2.h first.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 12, 2018, 11:05:52 pm
Thanks Dave. I was running it wrong, I was able to catch the log as you told me.

Title: Re: Compiling my first WPS application
Post by: Lars on December 12, 2018, 11:08:09 pm
GCC -Zomf -c hwman.cpp
If you want to compile only
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 12, 2018, 11:17:14 pm
Or
gcc -Zomf -c hwman.cpp -o hwman.obj
or
gcc -Zomf -c hwman.cpp -o hwman.o
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 12, 2018, 11:20:57 pm
Looking at your errors, perhaps try compiling as C by changing the codes suffix from .cpp to .c, hwman.c
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 13, 2018, 03:23:55 am
Chapter 3 of the manual "Using the GNU Compiler Collection" should be mentioned regarding the file name assumptions. At least to know how it will be handled by the preprocessor and passed to the batch C compiler (cc1) or C++ compiler (cc1plus). Additionally the configuration of the gcc driver (or does FSF call it an interactive frontend?) should be checked.

Is there some OS/2 specific documentation besides emxdev.doc? So I would recommend to use this textfile that covers all build related tasks.
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 13, 2018, 05:20:45 am
Is there some OS/2 specific documentation besides emxdev.doc? So I would recommend to use this textfile that covers all build related tasks.

Emxdev.doc is a good start though out of date, eg no single threading version of the library anymore. There's also the release notes etc that don't seem to be installed by yum/rpm, start here [url:http://trac.netlabs.org/libc/browser/trunk/doc] though also somewhat out of date and the netlabs pages, start at [url:http://trac.netlabs.org/libc].
Really emxdoc needs bringing up to date. Perhaps Martin could start a wiki page.
Title: Re: Compiling my first WPS application
Post by: Lars on December 13, 2018, 10:05:49 am
Looking at your errors, perhaps try compiling as C by changing the codes suffix from .cpp to .c, hwman.c

You cannot. The file headers contain the "class" C++ keyword. A C-compiler has no clue how to handle that and what it means.
There are multiple problems with gcc, for once, I suspect that the various typedefs like SOMEXTERN etc. are not properly defined anywhere, at least not in the header files that come with gcc. If you use the toolkit headers, gcc might barf because it does not understand certain pragmas etc. etc.
Next, I seem to remember that gcc uses "C" as default calling convention and not SYSCALL (_System) as the IBM and Watcom compilers do (which is relevant for example regarding the generated symbol names), so you have to make sure that you pick the correct gcc switch to tell it to use SYSCALL calling convention.

I had also tried to use gcc in the past. gcc is good for porting UNIX programs but it is a nightmare for native OS/2 development. Is has no decent source code debugger (only a lousy command line version that gives me the creeps).

Use Watcom if you really want to get into it. That is a decent compiler and it has a GUI source code debugger. I have used Watcom for native OS/2 development and while the linker command file syntax is frightening, you will always find a good template if you look around :-)
Title: Re: Compiling my first WPS application
Post by: Lars on December 13, 2018, 12:07:05 pm
Thanks Dave. I was running it wrong, I was able to catch the log as you told me.

1) do not use the header files from your VAC installation (\ibmcxxo\include) . Use the ones from \os2tk45\h. Make sure that CPLUS_INCLUDE_PATH points to that dir or pass this dir via the -I switch to the compiler
2) use "-fpermissive" switch for compiler
3) define "APIRET16" to be "unsigned short" or "USHORT"
4) define "_Seg16" to be nothing
5) use "-Wno-write-strings" switch for compiler

There is still other stuff that gives problems. Have fun.
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 13, 2018, 04:47:42 pm
You cannot. The file headers contain the "class" C++ keyword. A C-compiler has no clue how to handle that and what it means.
Sorry, but SOM is language neutral. A C preprocessor or C compiler wouldn't use the extended headers. And there's of course no reason.

Depending on the used environment, where you can choose between the old star or CORBA, the SOM compiler
sc -sh;ih;c *.idl
produces the files that can be used with C compilation systems.
Title: Re: Compiling my first WPS application
Post by: Lars on December 13, 2018, 04:55:52 pm
Yes, SOM is language neutral. But the generated C++ bindings are not. Or the C bindings. Or the Pascal bindings. Or the Fortran bindings.

And I used the C++ bindings.

You don't have to be sorry. You just have to think.
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 13, 2018, 08:09:28 pm
Yes, SOM is language neutral. But the generated C++ bindings are not. Or the C bindings. Or the Pascal bindings. Or the Fortran bindings.
You seem to use a different version of IBM's SOMobjects. I cannot find any emitters for Pascal or Fortran. Of course you can write your emitters using the efw. Or you have to install first a third party product that offers those features. I only know of IBM's COBOL, PL/I and Smalltalk offerings that included the required support.

Idę na kolację...
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 13, 2018, 11:25:04 pm

Side Note: Which is the latest "emxdev.doc" available? I had found 0.8h / 14-Dec-1993 (http://cd.textfiles.com/hobbesos29411/LIB/EMX/DOC/EMXDEV.DOC)
Title: Re: Compiling my first WPS application
Post by: Dave Yeo on December 14, 2018, 01:28:56 am
My one is dated 21-Dec-1998. Seems to be in the http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxdev1.zip (http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxdev1.zip) package along with emxlib.doc, which is also somewhat relevant for using kLIBC. http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxview.zip (http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxview.zip) has them in INF format, which is nicer to use.
The source is in http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxsrcd1.zip (http://hobbes.nmsu.edu/download/pub/os2/dev/emx/v0.9d/emxsrcd1.zip) under emx\src\doc and I guess the source code to build it is in emx\src\emxdoc while the binaries are in the regular EMX packages.
All GPLv2
edit, I don't which make was used, possibly dmake.
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 14, 2018, 01:47:55 am
Dave is fast and right. Nothing much to add.

A second source: https://sourceforge.net/projects/emx/rss?path=/emx/0.9d-fix04 (official)

And emxdoc can not only generate IPF but also HTML.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 21, 2018, 04:04:42 pm
Hi

I had wrote this quick article about my experience compiling HWMan.
It is located here: http://www.edm2.com/index.php/Compiling_HWMan_WPS_Class_on_ArcaOS_5.x (http://www.edm2.com/index.php/Compiling_HWMan_WPS_Class_on_ArcaOS_5.x)

Constructive criticism and spell/grammar check are always welcome.

Regards
Title: Re: Compiling my first WPS application
Post by: Pete on December 21, 2018, 07:06:16 pm
Hi All

Having followed this thread and seen the hoops "c" programmers have to jump through to accomplish anything I am glad that I decided to use WDSibyl as my choice of occasional development tool/app.

Good luck to all you "c" programmers  :-)


Regards

Pete
Title: Re: Compiling my first WPS application
Post by: Lars on December 27, 2018, 12:42:44 pm
Hi

I had wrote this quick article about my experience compiling HWMan.
It is located here: http://www.edm2.com/index.php/Compiling_HWMan_WPS_Class_on_ArcaOS_5.x (http://www.edm2.com/index.php/Compiling_HWMan_WPS_Class_on_ArcaOS_5.x)

Constructive criticism and spell/grammar check are always welcome.

Regards


you do not necessarily need Netscape Communicator to install VAC 3.6.5. Alex Taylor has published articles on how to use an install object to install the application (I cannot find it right now). In fact I "pimped" my installation CD-ROM so that I can install VAC 3.6.5 without ever running Netscape Communicator.

What you effectively need to do is create an installation object and import the "PORTAPAK.RSP" file into the installation object.
Here is something that you can run from a batch file. Replace and rename directories as appropriate (the notes I wrote down):

C.  Invoking installation directly through an installation object
    I have reworked and modified PORTAPAK.RSP (on your VAC 3.6.5 installation CD-ROM) so that it can also be used to create an installation object.
    You create an installation object via CLIFI.EXE (it is installed on every OS/2 machine) once you have burned a new CD-ROM from the original
    CD-ROM and these patches.

    For what follows, assume this:
    a.) your CD-ROM is drive V:
    b.) you want VAC 3.6.5 installed to drive D: and directory IBMC365
    c.) you want the OS/2 toolkit installed to drive E: and directory TOOLKIT

    echo /O:ROOT >parms.txt
    echo /SET:InstDrv1=D: >> parms.txt
    echo /SET:InstDrv2=E: >> parms.txt
    echo /SET:InstDir1=IBMC365 >> parms.txt
    echo /SET:InstDir2=TOOLKIT >> parms.txt
    echo /SET:PackagedFromPath=V:\COMPILER >> parms.txt
    echo /SET:ImageMediaPath=V:\COMPILER >>parms.txt
    echo /R:V:\COMPILER\PORTAPAK.RSP >>parms.txt
    echo /S:V:\COMPILER >>parms.txt

    clifi.exe /A:B /F:"<WP_DESKTOP>" /PARMS:parms.txt

    The installation object is created on your desktop. If you open it you can select/deselect the individual features to install. After installation
    you can either delete the object or keep it around somewhere if you want to install later on.
    During installation, you are asked to specify the "Source Media": just reenter the path: V:\COMPILER

I DID slightly modify file PORTAPAK.RSP but it should also work with the unmodified version.
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 27, 2018, 04:31:47 pm
Thanks Lars, I will search for Alex docs too.

I know that " IBM C and C++ Compilers, Version 3.6.5" is called  VAC 3.6.5, but I never understood why.
Please correct me if I'm wrong, the order of releases should be:
- IBM C Set/2 1.0
- IBM C Set++ for OS/2 2.0
- IBM VisualAge C++ 3.0
- IBM C and C++ Compilers, Version 3.6.5
- IBM VisualAge C++ Professional 4.0 - which I had been told it is buggy and it is not recommend to use it, right?

Regards
Title: Re: Compiling my first WPS application
Post by: Alex Taylor on December 27, 2018, 11:51:43 pm
My old Feature Install without Netscape articles were published in the old VOICE newsletter.
Basic techniques: http://www.os2voice.org/VNL/past_issues/VNL1007H/feature_2.html
Advanced topics: http://www.os2voice.org/VNL/past_issues/VNL0708H/feature_2.html

(Back at the time, I started work on a third part which covered even more advanced topics, but that effort ran out of steam once the newsletter went defunct.)
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 28, 2018, 04:04:53 am
I know that " IBM C and C++ Compilers, Version 3.6.5" is called  VAC 3.6.5, but I never understood why.
For confusion.

Quote
Please correct me if I'm wrong, the order of releases should be:
- IBM C Set/2 1.0
- IBM C Set++ for OS/2 2.0
- IBM VisualAge C++ 3.0
- IBM C and C++ Compilers, Version 3.6.5
- IBM VisualAge C++ Professional 4.0 - which I had been told it is buggy and it is not recommend to use it, right?
Now the order of the list should be correct. It seems, the "buggy" came from people that didn't use it all.

A simplified list of IBM's workstation C++ compiler by released products:
Code: [Select]
V1

   5765-035 - IBM XL C ++ Compiler/6000 V1 (Jun 1992), V1.1.1 (Nov 1992)

V2

    5604-464 - IBM C Set++ V2.0 (Jun 1993)
    5604-465 - IBM C Set++ V2.0 CD-ROM
    5604-466 - IBM C/C++ Tools V2
    5765-186 - IBM C Set ++ for AIX/6000 Version 2 (Dec 1993)
    5604-534 - IBM C Set ++ FirstStep V2.1 / IBM C/C++ FirstStep Tools V2.01 (Dec 1993)
    5604-535 - IBM C Set++ V2.1 / IBM C/C++ Tools V2.01

V3

    5765-421 - C Set ++ for AIX V3.0 (Oct 1994), C Set++ for AIX Version 3.1.4
    5765-448 - C Set ++ for Solaris, V1 (Mar 1995)
    5622-679 - IBM VisualAge C++ for OS/2 V3.0 (Jun 1995), German Version (Apr 1996)
    5622-880 - IBM VisualAge C++ for Windows Version 3.5 (Mar 1996)
    5648-A81 - C and C++ Compilers for OS/2, AIX and Windows NT Version 3.6 (Dec 1997 - Dec 1998)

V4

    5765-D52 - IBM VisualAge C++ Professional for AIX, Version 4.0 (Jul 1998 - Apr 2001)
    5639-F24 - IBM VisualAge C++ Professional for OS/2 and Windows NT, Version 4.0 (Dec 1998 - Jun 2002)

V5

    5765-E26 - VisualAge C++ Professional for AIX, V5.0 (Mar 2000 - Dec 2003)

V6

    5765-F56 - IBM VisualAge C++ Professional for AIX V6.0 (Jul 2002 - Mar 2006)
    5765-F56 - IBM VisualAge C++ V6.0 for Linux (Mar 2003)
Title: Re: Compiling my first WPS application
Post by: Lars on December 28, 2018, 01:48:09 pm
1) VAC  = "Visual Age for C++"
2) no, the list is now wrong. There was a version 3.0 , 3.6.5 and 4.0 for OS/2 and Martin's list was correct. Version 3.0 did not support 64-bit data types, Version 3.6.5 did and Version 4.0 has a completely different IDE (also getting rid of using conventional makefiles). These are completely different products.

Bogdan aka Andreas Kohl aka ak120 aka Andreas Kohl (in cyrillic letters) I think it's time for you to step up from behind the bush. It can only be you to write such nonsense.
Being the smart ass that you are I am sure you thought it was a brilliant idea to change the user name to not being banned again.

@Martin: of course it is now up to you what you want to believe or not.
Title: Re: Compiling my first WPS application
Post by: Bogdan on December 29, 2018, 07:07:16 am
1) VAC  = "Visual Age for C++"
Most people would think about voltage analogue current. But perhaps the dictionaries in Germany have different entries.

Quote
2) no, the list is now wrong. There was a version 3.0 , 3.6.5 and 4.0 for OS/2 and Martin's list was correct. Version 3.0 did not support 64-bit data types, Version 3.6.5 did and Version 4.0 has a completely different IDE (also getting rid of using conventional makefiles). These are completely different products.
Sorry, you're speaking about versions and the original question was for releases. The mentioned "3.6.5 and 4.0 for OS/2" are in fact combined into only one product. So it seems you're making claims without any proof. Hopefully not all Germans have this ignorant behaviour. I provided the list on my own here without the help from any German or Russian ghost writer. To make it German over-engineered you can simply duplicate one line to deal with your version aspect. It's not good tradition to make me guilty by association or to invent new conspiracy theories.

Człowiek nie wybiera.
Title: Re: Compiling my first WPS application
Post by: Lars on December 29, 2018, 01:38:15 pm
Du hast Recht und ich habe meine Ruhe.
Title: Re: Compiling my first WPS application
Post by: Sigurd Fastenrath on December 29, 2018, 04:12:37 pm
1) VAC  = "Visual Age for C++"
Most people would think about voltage analogue current. But perhaps the dictionaries in Germany have different entries.

Quote
2) no, the list is now wrong. There was a version 3.0 , 3.6.5 and 4.0 for OS/2 and Martin's list was correct. Version 3.0 did not support 64-bit data types, Version 3.6.5 did and Version 4.0 has a completely different IDE (also getting rid of using conventional makefiles). These are completely different products.
Sorry, you're speaking about versions and the original question was for releases. The mentioned "3.6.5 and 4.0 for OS/2" are in fact combined into only one product. So it seems you're making claims without any proof. Hopefully not all Germans have this ignorant behaviour. I provided the list on my own here without the help from any German or Russian ghost writer. To make it German over-engineered you can simply duplicate one line to deal with your version aspect. It's not good tradition to make me guilty by association or to invent new conspiracy theories.

Człowiek nie wybiera.

Andreas Kohl aka Bogdan Szmalcownik is banned from this forum, isn't he?
Title: Re: Compiling my first WPS application
Post by: Martin Iturbide on December 29, 2018, 04:39:07 pm
Hi

I wanted to give a second change to Andreas (Bogdan Szmalcownik), since he seems more calm now. I advice Andreas to move on the subject, and to the rest just reply him "I disagree with your point of view because x and y" and move on.

Regards
Title: Re: Compiling my first WPS application
Post by: Ian Manners on December 29, 2018, 05:28:27 pm
Quote
I wanted to give a second change to Andreas (Bogdan Szmalcownik), since he seems more calm now. I advice Andreas to move on the subject, and to the rest just reply him "I disagree with your point of view because x and y" and move on.

Ya, some of us do frequent os2.org, looking at you Andreas, and though my other languages are rusty, I can still figure out enough  ;D
Otherwise, as Martin said.
Title: Re: Compiling my first WPS application
Post by: Sigurd Fastenrath on December 31, 2018, 07:53:46 am
Hi

I wanted to give a second change to Andreas (Bogdan Szmalcownik), since he seems more calm now. I advice Andreas to move on the subject, and to the rest just reply him "I disagree with your point of view because x and y" and move on.

Regards

I wonder wether or not this would have been handeld the same way if Bogdan/Andreas Kohl would have named the US instead of German every time in his last post. It is obvious that the reasons for this behaviour are:
- dissappointed former east german life
- defect

For me this leads to not participate any longer in this forum. No, that is not some kind of threat, or fishing for "please stay", it is just because if people of his kind are given a plattform to attac others the way he does, and the answer is "move on", than it is time for me to leave this plattform. At os2org me, and not only me, are using the Ignore function, that makes it easy to avoid being bored by his personal attacs and everything else he might want to let the world know.

Just one question: if I delete my account, will my postings will be deleted as well? Thanks for an answer in advance.
Title: Re: Compiling my first WPS application
Post by: Lars on December 31, 2018, 10:35:10 am
you do not necessarily need Netscape Communicator to install VAC 3.6.5. Alex Taylor has published articles on how to use an install object to install the application (I cannot find it right now). In fact I "pimped" my installation CD-ROM so that I can install VAC 3.6.5 without ever running Netscape Communicator.

I just remember that I created a zip of updated files for the VAC 3.6.5 installation CD-ROM. Basically you copy your CD to the harddisk, drop the contents of the ZIP over it and reburn the CD-ROM.

It's here:
http://hobbes.nmsu.edu/download/pub/os2/dev/cplusplus/patches/vacinstfix2.zip