Author Topic: Compiling my first WPS application  (Read 1601 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 319
  • -Receive: 60
  • Posts: 2072
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #15 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
« Last Edit: December 08, 2018, 07:00:47 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Lars

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 33
  • Posts: 286
    • View Profile
Re: Compiling my first WPS application
« Reply #16 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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 319
  • -Receive: 60
  • Posts: 2072
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #17 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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 9
  • -Receive: 112
  • Posts: 1644
    • View Profile
Re: Compiling my first WPS application
« Reply #18 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.

Lars

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 33
  • Posts: 286
    • View Profile
Re: Compiling my first WPS application
« Reply #19 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.
« Last Edit: December 09, 2018, 10:07:41 am by Lars »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 319
  • -Receive: 60
  • Posts: 2072
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #20 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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Bogdan Szmalcownik

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 65
    • View Profile
Re: Compiling my first WPS application
« Reply #21 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/

Lars

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 33
  • Posts: 286
    • View Profile
Re: Compiling my first WPS application
« Reply #22 on: December 09, 2018, 08:36:20 pm »
Bullshit.
It IS C++ Code. You cannot just rename the files.
You have no clue.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 9
  • -Receive: 112
  • Posts: 1644
    • View Profile
Re: Compiling my first WPS application
« Reply #23 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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 319
  • -Receive: 60
  • Posts: 2072
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #24 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
« Last Edit: December 10, 2018, 05:26:01 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Lars

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 33
  • Posts: 286
    • View Profile
Re: Compiling my first WPS application
« Reply #25 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.

Lars

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 33
  • Posts: 286
    • View Profile
Re: Compiling my first WPS application
« Reply #26 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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 319
  • -Receive: 60
  • Posts: 2072
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #27 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
« Last Edit: December 10, 2018, 02:21:01 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Neil Waldhauer

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 22
  • Posts: 380
    • View Profile
    • Blonde Guy
Re: Compiling my first WPS application
« Reply #28 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.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Bogdan Szmalcownik

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 65
    • View Profile
Re: Compiling my first WPS application
« Reply #29 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" \
  ...