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

Bogdan

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +1/-0
    • View Profile
Re: Compiling my first WPS application
« Reply #30 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.

Bogdan

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +1/-0
    • View Profile
Re: Compiling my first WPS application
« Reply #31 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

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: Compiling my first WPS application
« Reply #32 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.)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #33 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.
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #34 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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

xynixme

  • Guest
Re: Compiling my first WPS application
« Reply #35 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

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Compiling my first WPS application
« Reply #36 on: December 11, 2018, 01:37:16 pm »
make.exe "DEBUG=1" (no spaces, with surrounding apostrophy)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #37 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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Bogdan

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +1/-0
    • View Profile
Re: Compiling my first WPS application
« Reply #38 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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #39 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.
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #40 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

« Last Edit: December 12, 2018, 04:40:31 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Compiling my first WPS application
« Reply #41 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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #42 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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Compiling my first WPS application
« Reply #43 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.
« Last Edit: December 12, 2018, 11:15:10 pm by Dave Yeo »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling my first WPS application
« Reply #44 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.

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